is-primitive
Version:
Returns `true` if the value is a primitive.
16 lines (13 loc) • 319 B
JavaScript
/*!
* is-primitive <https://github.com/jonschlinkert/is-primitive>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*/
;
module.exports = function isPrimitive(val) {
if (typeof val === 'object') {
return val === null;
}
return typeof val !== 'function';
};