UNPKG

iif-ts

Version:

A tiny utility function to conditionally insert elements into arrays or objects using the spread operator. Supports both eager and deferred evaluation.

3 lines 234 B
export declare function iifArray<T>(condition: boolean, ...values: (T | (() => T))[]): T[]; export declare function iifObject<T extends object>(condition: boolean, value: T | (() => T)): Partial<T>; //# sourceMappingURL=index.d.ts.map