UNPKG

payload-is

Version:

A comprehensive TypeScript/JavaScript type checking library providing functions to check data types, collections, primitives, and built-in objects

22 lines (19 loc) 643 B
import { isNumber } from './number.js'; import { isObject } from './object.js'; import { isString } from './string.js'; import { isSymbol } from './symbol.js'; import './type.js'; function isWeakKey(payload) { return isObject(payload) || isSymbol(payload); } function isPropertyKey(payload) { return isString(payload) || isNumber(payload) || isSymbol(payload); } function enumerableKeys(value) { return Reflect.ownKeys(value).filter((key) => { const desc = Object.getOwnPropertyDescriptor(value, key); return desc && desc.enumerable; }); } export { enumerableKeys, isPropertyKey, isWeakKey }; //# sourceMappingURL=key.js.map