diff options
Diffstat (limited to 'node_modules/es-abstract/5/Type.js')
-rw-r--r-- | node_modules/es-abstract/5/Type.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/node_modules/es-abstract/5/Type.js b/node_modules/es-abstract/5/Type.js new file mode 100644 index 000000000..9cc750cd5 --- /dev/null +++ b/node_modules/es-abstract/5/Type.js @@ -0,0 +1,24 @@ +'use strict'; + +// https://www.ecma-international.org/ecma-262/5.1/#sec-8 + +module.exports = function Type(x) { + if (x === null) { + return 'Null'; + } + if (typeof x === 'undefined') { + return 'Undefined'; + } + if (typeof x === 'function' || typeof x === 'object') { + return 'Object'; + } + if (typeof x === 'number') { + return 'Number'; + } + if (typeof x === 'boolean') { + return 'Boolean'; + } + if (typeof x === 'string') { + return 'String'; + } +}; |