export function isEmpty ( obj ) { if ( Array . isArray ( obj ) || isString ( obj ) || isBuffer ( obj ) ) { return obj . length === 0 ; } else if ( obj ) { return Object . keys ( obj ) . length === 0 ; } return false ; } export function isString ( obj ) { return typeof obj === 'string' ; } export function isNumber ( obj ) { return typeof obj === 'number' ; } export function isBoolean ( obj ) { return typeof obj === 'boolean' ; } export function isNull ( obj ) { return obj === null ; } export function isDate ( obj ) { return obj instanceof Date ; } export function isBigInt ( obj ) { return typeof obj === 'bigint' ; } export function isBuffer ( obj ) { return typeof Buffer !== 'undefined' && Buffer . isBuffer ( obj ) ; } export function isFunction ( obj ) { return typeof obj === 'function' ; } export function isObject ( obj ) { return typeof obj === 'object' && obj !== null ; } export function getLast < T > ( arr ) { return arr [ arr . length - 1 ] ; } export function freeze < T > ( obj ) { return Object . freeze ( obj ) ; } export function asArray < T > ( arg ) { if ( Array . isArray ( arg ) ) { return arg ; } else { return [ arg ] ; } } export function asReadonlyArray < T > ( arg ) { if ( isReadonlyArray ( arg ) ) { return arg ; } else { return freeze ( [ arg ] ) ; } } export function isReadonlyArray ( arg ) { return Array . isArray ( arg ) ; } export function noop < T > ( obj ) { return obj ; }