- objPick<Type, Key>(a: Type, keys: string[] | Key[], options?: {
defaultValue?: unknown;
upsert?: boolean;
}): Record<string | Key, Type[keyof Type]>
-
Type Parameters
-
Type extends Record<string | number | symbol, unknown>
-
Key extends string | number | symbol
Parameters
-
a: Type
-
keys: string[] | Key[]
-
Optional options: {
defaultValue?: unknown;
upsert?: boolean;
}
-
Optional defaultValue?: unknown
-
Optional upsert?: boolean
Returns Record<string | Key, Type[keyof Type]>
Returns a new object with the specified keys from a source object
Example