validx
Version:
Validation library for MobX
19 lines (18 loc) • 784 B
TypeScript
export declare type Iteratee<V, K, O, R> = (value: V, key: K, source: O) => R;
/**
* Invokes the iteratee for each item in the array or object.
*/
export declare function forEach<T>(array: T[], iteratee: Iteratee<T, number, T[], any>): T[];
export declare function forEach<T>(source: T, iteratee: Iteratee<any, string, T, any>): T;
/**
* Determines if every element in the collection statisfies the predicate.
* @type {T[]}
*/
export declare function every<T>(array: T[], predicate: Iteratee<T, number, T[], boolean>): boolean;
export declare function every<T>(source: T, predicate: Iteratee<any, string, T, boolean>): boolean;
/**
* Creates an object hash from a map.
*
* @param map
*/
export declare function mapToObject<K extends string, V>(map: Map<K, V>): Record<K, V>;