Sha256: df056d38c10657a1ad6d0321ca7bd11dc464fd15915388601afe9d700448a1c5
Contents?: true
Size: 467 Bytes
Versions: 62
Compression:
Stored size: 467 Bytes
Contents
/** * Checks if the object is a primitive */ function isPrimitive(value) { // Using switch fallthrough because it's simple to read and is // generally fast: http://jsperf.com/testing-value-is-primitive/5 switch (typeof value) { case "string": case "number": case "boolean": return true; } return value == null; } module.exports = isPrimitive;
Version data entries
62 entries across 62 versions & 1 rubygems