const convert = (function(e) {
	if (e == null) return ok;
	if (typeof e == "function") return castFactory(e);
	if (typeof e == "object") return Array.isArray(e) ? anyFactory(e) : propertiesFactory(e);
	if (typeof e == "string") return typeFactory(e);
	throw Error("Expected function, string, or object as test");
});
function anyFactory(n) {
	let r = [], i = -1;
	for (; ++i < n.length;) r[i] = convert(n[i]);
	return castFactory(o);
	function o(...e) {
		let n = -1;
		for (; ++n < r.length;) if (r[n].apply(this, e)) return !0;
		return !1;
	}
}
function propertiesFactory(e) {
	let n = e;
	return castFactory(r);
	function r(r) {
		let i = r, a;
		for (a in e) if (i[a] !== n[a]) return !1;
		return !0;
	}
}
function typeFactory(e) {
	return castFactory(n);
	function n(n) {
		return n && n.type === e;
	}
}
function castFactory(e) {
	return n;
	function n(n, r, i) {
		return !!(looksLikeANode(n) && e.call(this, n, typeof r == "number" ? r : void 0, i || void 0));
	}
}
function ok() {
	return !0;
}
function looksLikeANode(e) {
	return typeof e == "object" && !!e && "type" in e;
}
export { convert };
