@technobuddha/library
Version:
A large library of useful functions
17 lines (16 loc) • 436 B
JavaScript
/**
* Check to see if an object is a primitive
*
* @param input object to test
* @returns true, if the object is a c
*/
export function isPrimitive(input) {
return input === null ||
input === undefined ||
typeof input === 'string' ||
typeof input === 'number' ||
typeof input === 'bigint' ||
typeof input === 'boolean' ||
typeof input === 'symbol';
}
export default isPrimitive;