@technobuddha/library
Version:
A large library of useful functions
19 lines (18 loc) • 557 B
TypeScript
/**
* Check to see if an object is a primitive
* @param input - object to test
* @returns true, if the object is a primitive
* @group Object
* @category Type Guards
* @example
* ```typescript
* isPrimitive(42); // true
* isPrimitive('hello'); // true
* isPrimitive(null); // true
* isPrimitive(undefined); // true
* isPrimitive(Symbol('s')); // true
* isPrimitive({}); // false
* isPrimitive([]); // false
* ```
*/
export declare function isPrimitive(input: unknown): input is null | undefined | string | number | bigint | boolean | symbol;