typedash
Version:
modern, type-safe collection of utility functions
24 lines (21 loc) • 1.36 kB
text/typescript
import { K as KeysOfUnion } from '../KeysOfUnion-BrkZWXzm.cjs';
import { M as Many } from '../Many-Dnn8Ysh_.cjs';
import { M as Maybe } from '../Maybe-D6dwMjD9.cjs';
import { O as ObjectPredicate } from '../createObjectPredicate-2CUCZ3yY.cjs';
import '../CastToString-BoaHrryS.cjs';
import 'type-fest';
/**
* Returns a new object with all properties except the specified properties from the input object.
* @param object The input object to omit properties from.
* @param properties An array of property names to omit from the input object.
* @returns A new object with all properties except the specified properties from the input object.
*/
declare function omit<T extends object, const K extends keyof T | KeysOfUnion<T>>(object: Maybe<T>, properties: Many<K>): Omit<T, K>;
/**
* Returns a new object with all properties except the properties that satisfy the predicate function from the input object.
* @param object The input object to omit properties from.
* @param predicate A function that takes a property value and its key and returns a boolean indicating whether to omit the property or not.
* @returns A new object with all properties except the properties that satisfy the predicate function from the input object.
*/
declare function omit<T extends object>(object: Maybe<T>, predicate: ObjectPredicate<T>): Partial<T>;
export { omit };