UNPKG

is-primitive-x

Version:

Returns true if the value is a primitive.

15 lines (12 loc) 715 B
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } /** * Returns true if the value is a primitive. * * @param {*} [val] - The value to test. * @returns {boolean} True if a primitive, otherwise false.. */ var isPrimitive = function isPrimitive(val) { return _typeof(val) === 'object' ? val === null : typeof val !== 'function'; }; export default isPrimitive; //# sourceMappingURL=is-primitive-x.esm.js.map