Skip to content

Instantly share code, notes, and snippets.

@roman01la
Last active June 2, 2020 16:25
Embed
What would you like to do?
function googIsObject(v) {
var type = typeof v;
return "object" == type && null != v || "function" == type;
}
function isPrototype(v) {
return v === v.constructor.prototype;
}
function isCLJSType(v) {
return v.cljs$lang$type === true && googIsObject(v) && !isPrototype(v);
}
function isCLJSInstance(v) {
return googIsObject(v) && isCLJSType(v.constructor);
}
function isCLJSValue(v) {
// TODO: cljs-fn?
// TODO: print Symbol
return isCLJSInstance(v) && !isPrototype(v) && (typeof v !== "symbol");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment