omitFromObject
Creates a new object that excludes the specified keys from the original object.> omitFromObject<T, K>(params: OmitFromObjectParams<T, K>): Omit<T, K>
- obj: (T | undefined): The original object from which keys will be omitted.
- keys: (K[]): An array of keys to omit from the object.
- Returns: A new object excluding the omitted keys.
Example
import { omitFromObject } from "@explita/daily-toolset";
const original = { a: 1, b: 2, c: 3 };
const omitted = omitFromObject({ obj: original, keys: ['b'] });
// Result: { a: 1, c: 3 }