UNPKG

@monstermann/fn

Version:

A utility library for TypeScript.

23 lines (21 loc) 623 B
import { DistributedOmit, KeysOfUnion } from "type-fest"; //#region src/object/omit.d.ts /** * `omit(target, keys)` * * Creates a new object excluding the properties specified in the `keys` iterable. * * ```ts * omit({ a: 1, b: 2, c: 3 }, ["a", "c"]); // { b: 2 } * ``` * * ```ts * pipe({ a: 1, b: 2, c: 3 }, omit(["a", "c"])); // { b: 2 } * ``` */ declare const omit: { <T extends object, K extends KeysOfUnion<T>>(keys: Iterable<K>): (target: T) => DistributedOmit<T, K>; <T extends object, K extends KeysOfUnion<T>>(target: T, keys: Iterable<K>): DistributedOmit<T, K>; }; //#endregion export { omit };