UNPKG

tamda

Version:

Practical functional programming library for TypeScript

27 lines (26 loc) 1.05 kB
/** * Creates a new object with all properties but `props` from the `source` object. * @param source Object to pick properties from. * @param props Properties to exclude from the resulting object. * @example * const source = { id: 1, original: true }; * exclude(source, 'original'); * // { id: 1 } */ export declare function exclude<T extends object>(source: T, ...props: (keyof T)[]): Partial<T>; /** * Creates a new object with all properties but `props` from the `source` object. * @param props Properties to exclude from the resulting object. * @example * const source = { id: 1, original: true }; * const justId = exclude('original'); * justId(source); * // { id: 1 } */ export declare function exclude<T extends object>(...props: (keyof T)[]): typeof deferred; /** * Creates a new object with all properties but previously specified `props` from the `source` object. * @param source Object to pick properties from. */ declare function deferred<T extends object>(source: T): Partial<T>; export {};