omit
Creates a new object without the specified keys.
Available since v2.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
obj | T | The source object |
keys | readonly K[] | The keys to omit |
Returns
Section titled “Returns”Omit<T, K> — A new object without the omitted keys
Examples
Section titled “Examples”Omit specific keys
Section titled “Omit specific keys”Creates a new object without the specified keys.
Remove sensitive fields
Section titled “Remove sensitive fields”Useful to strip sensitive data before sending to client.
