Record<string | number | symbol, undefined> & object Frozen empty object with no properties, good for options default values.
9 declarations
Record<string | number | symbol, undefined> & object Frozen empty object with no properties, good for options default values.
(value: any): boolean Returns a boolean indicating if value is
a plain object, possibly created with Object.create(null).
But warning! This fails for some obscure corner cases, use a proper library for weird things.
valueanyboolean <T, K extends string | number, U>(obj: Record<K, T>, mapper: (value: T, key: string) => U): Record<K, U> Iterated keys in for..in are always returned as strings,
so to prevent usage errors the key type of mapper is always a string.
Symbols are not enumerable as keys, so they're excluded.
objRecord<K, T>mapper(value: T, key: string) => URecord<K, U> <T extends Record<K, any>, K extends keyof T>(obj: T, keys: K[]): OmitStrict<T, K> Creates a new object without the specified keys.
objTkeysK[]OmitStrict<T, K> <T extends Record<string | number, any>>(obj: T): T omit_undefined is a commonly used form of pick_by. See this issue for why it's used so much: https://github.com/Microsoft/TypeScript/issues/13195
objthe object to filter
TT obj with all undefined properties removed
<T extends Record<K, any>, K extends string | number>(obj: T, should_pick: (value: any, key: K) => boolean): Partial<T> Creates a new object with properties that pass the should_pick predicate.
objTshould_pick(value: any, key: K) => booleanPartial<T> <T extends Record<K, any>, K extends string | number>(obj: T, keys: K[]): T A more explicit form of {put_this_first: obj.put_this_first, ...obj}.
objTkeysK[]T <T>(obj: T): T | undefined objTT | undefined (obj: any, cb: (key: string, value: any, obj: any) => void): void Performs a depth-first traversal of an object's enumerable properties,
calling cb for every key and value with the current obj context.
objany object with enumerable properties
anycbreceives the key, value, and obj for every enumerable property on obj and its descendents
(key: string, value: any, obj: any) => voidvoid