UNPKG

1.28 kBTypeScriptView Raw
1import { ObjectLiteral } from "../common/ObjectLiteral";
2export declare class OrmUtils {
3 /**
4 * Chunks array into peaces.
5 */
6 static chunk<T>(array: T[], size: number): T[][];
7 static splitClassesAndStrings<T>(clsesAndStrings: (string | T)[]): [T[], string[]];
8 static groupBy<T, R>(array: T[], propertyCallback: (item: T) => R): {
9 id: R;
10 items: T[];
11 }[];
12 static uniq<T>(array: T[], criteria?: (item: T) => any): T[];
13 static uniq<T, K extends keyof T>(array: T[], property: K): T[];
14 static isObject(item: any): boolean;
15 /**
16 * Deep Object.assign.
17 *
18 * @see http://stackoverflow.com/a/34749873
19 */
20 static mergeDeep(target: any, ...sources: any[]): any;
21 /**
22 * Deep compare objects.
23 *
24 * @see http://stackoverflow.com/a/1144249
25 */
26 static deepCompare(...args: any[]): boolean;
27 /**
28 * Transforms given value into boolean value.
29 */
30 static toBoolean(value: any): boolean;
31 /**
32 * Composes an object from the given array of keys and values.
33 */
34 static zipObject(keys: any[], values: any[]): ObjectLiteral;
35 /**
36 * Compares two arrays.
37 */
38 static isArraysEqual(arr1: any[], arr2: any[]): boolean;
39 private static compare2Objects;
40}
41
\No newline at end of file