UNPKG

super-utils-plus

Version:

A superior alternative to Lodash with improved performance, TypeScript support, and developer experience

33 lines (32 loc) 948 B
/** * Creates an object composed of the own enumerable property paths of object that are not omitted. * * @param object - The source object * @param paths - The property paths to omit * @returns The new object * * @example * ```ts * const object = { 'a': 1, 'b': 2, 'c': 3 }; * * omit(object, ['a', 'c']); * // => { 'b': 2 } * ``` */ export declare function omit<T extends object, K extends keyof T>(object: T, paths: K[] | string[]): Omit<T, K>; /** * Creates an object composed of the object properties predicate returns falsey for. * * @param object - The source object * @param predicate - The function invoked per property * @returns The new object * * @example * ```ts * const object = { 'a': 1, 'b': 2, 'c': 3 }; * * omitBy(object, (value) => value >= 2); * // => { 'a': 1 } * ``` */ export declare function omitBy<T extends object>(object: T, predicate: (value: T[keyof T], key: string) => boolean): Partial<T>;