@tienedev/datype
Version:
Modern TypeScript utility library with pragmatic typing and zero dependencies
18 lines • 730 B
TypeScript
/**
* Creates a new object excluding the specified keys from the source object.
* Provides perfect TypeScript type inference for the resulting object.
*
* @param obj - The source object to omit from
* @param keys - Array of keys to exclude from the source object
* @returns A new object without the specified keys
*
* @example
* ```typescript
* const user = { id: 1, name: 'John', email: 'john@example.com', age: 30 };
* const publicInfo = omit(user, ['email', 'age']);
* // Result: { id: 1, name: 'John' }
* // Type: { id: number; name: string }
* ```
*/
export declare function omit<T extends Record<string, unknown>, K extends keyof T>(obj: T, keys: readonly K[]): Omit<T, K>;
//# sourceMappingURL=index.d.ts.map