UNPKG

@lou.codes/predicates

Version:
16 lines (15 loc) 506 B
/** * Checks if the given value is a valid PropertyKey of an object (`string`, `symbol`, or `number`). * * @category Objects * @example * ```typescript * isPropertyKey("Lou"); // true * isPropertyKey(1); // true * isPropertyKey(Symbol("Lou")); // true * isPropertyKey({}); // false * ``` * @param input Value to check. * @returns `true` if the given value is a valid PropertyKey of an object, `false` otherwise. */ export declare const isPropertyKey: (input: unknown) => input is PropertyKey;