Files
pikmin/lib/util/isSymbol.js
2019-04-22 22:15:37 +02:00

9 lines
307 B
JavaScript

const getTag = (val) => {
if (val === null) return val === undefined ? '[object Undefined]' : '[object Null]';
return toString.call(val);
};
module.exports = (val) => {
const type = typeof val;
return type === 'symbol' || (type === 'object' && val !== null && getTag(val) === '[object Symbol]');
};