@stryke/helpers
Version:
A package containing miscellaneous helper functions that are used across many different Storm Software projects.
19 lines (18 loc) • 652 B
TypeScript
/**
* Creates a new object with specified keys omitted.
*
* This function takes an object and an array of keys, and returns a new object that
* excludes the properties corresponding to the specified keys.
*
* @param obj - The object to omit keys from.
* @param keys - An array of keys to be omitted from the object.
* @returns A new object with the specified keys omitted.
*
* @example
* ```typescript
* const obj = { a: 1, b: 2, c: 3 };
* const result = omit(obj, ['b', 'c']);
* // result will be { a: 1 }
* ```
*/
export declare function omit<T extends Record<string, any>, K extends keyof T>(obj: T, keys: readonly K[]): Omit<T, K>;