removePropertiesFromArrayObjects
Function that, given an array of objects and a property or an array of properties, return a new array without specified properties.
Types
RemovePropertiesFromArrayObjectsProps
@templateT - The type of the objects in the array.@templateE - The type of the property key(s) to remove. Defaults tokeyof T.
Parameters accepted by removePropertiesFromArrayObjects.
| Property | Type | Required | Description |
|---|---|---|---|
array | T[] | ✓ | The array of objects from which properties should be removed. |
property | E \| E[] | ✓ | A single property key or an array of property keys to omit from each object in array. |
RemovePropertiesFromArrayObjectsResult
@templateT - The original object type.@templateE - The omitted property key type.
Return value of removePropertiesFromArrayObjects.
An array of objects of the same type as the input, with the specified property or properties omitted from each element.
ts
export type RemovePropertiesFromArrayObjectsResult<T, E extends string | number | symbol = keyof T> = Omit<T, E>[];