@exadel/esl
Version:
Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components
11 lines (10 loc) • 702 B
TypeScript
export type CopyPredicate = (key: string, value: any) => boolean;
/** Makes a plain copy of obj with properties satisfying the predicate
* If no predicate provided copies all own properties */
export declare function copy<T extends object>(obj: T, predicate?: CopyPredicate): Partial<T>;
/** Makes a flat copy without undefined keys */
export declare function copyDefinedKeys<T extends object>(obj?: T): Partial<T>;
/** Omits copying provided properties from object */
export declare function omit<T extends object>(obj: T, keys: string[]): Partial<T>;
/** Picks only provided properties from object */
export declare function pick<T extends object, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;