only
Commons
stable
Extract a strict subset of an object's keys into a new object. Unlike pick, every listed key is copied unconditionally — the result contains all listed keys, even when they are undefined on the source.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- objrequiredT
- The source object to extract properties from.
- includerequiredArray<U>
- Array of key names to copy into the output. Each key is iterated and set on the clone regardless of whether it exists on the source.
API
Return value
The value returned by this util.
- A new object containing only the listed keys and their values from the source.
Usage
Examples
Ready-to-paste usage snippets.
Extract specific keys