Last active
June 2, 2020 16:25
-
-
Save roman01la/c02b0204bda807d20b3413b6f7b799e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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