1 | import { Constructor } from './resolvers';
|
2 | /**
|
3 | * Quick flatten utility to flatten a 2-dimensional array.
|
4 | *
|
5 | * @param {Array<Array<Item>>} array
|
6 | * The array to flatten.
|
7 | *
|
8 | * @return {Array<Item>}
|
9 | * The flattened array.
|
10 | */
|
11 | export declare function flatten<T>(array: Array<Array<T>>): Array<T>;
|
12 | /**
|
13 | * Creates a { name: value } object if the input isn't already in that format.
|
14 | *
|
15 | * @param {string|object} name
|
16 | * Either a string or an object.
|
17 | *
|
18 | * @param {*} value
|
19 | * The value, only used if name is not an object.
|
20 | *
|
21 | * @return {object}
|
22 | */
|
23 | export declare function nameValueToObject(name: string | symbol | object, value?: any): Record<string | symbol, any>;
|
24 | /**
|
25 | * Returns the last item in the array.
|
26 | *
|
27 | * @param {*[]} arr
|
28 | * The array.
|
29 | *
|
30 | * @return {*}
|
31 | * The last element.
|
32 | */
|
33 | export declare function last<T>(arr: Array<T>): T;
|
34 | /**
|
35 | * Determines if the given function is a class.
|
36 | *
|
37 | * @param {Function} fn
|
38 | * @return {boolean}
|
39 | */
|
40 | export declare function isClass(fn: Function | Constructor<any>): boolean;
|
41 | /**
|
42 | * Determines if the given value is a function.
|
43 | *
|
44 | * @param {unknown} val
|
45 | * Any value to check if it's a function.
|
46 | *
|
47 | * @return {boolean}
|
48 | * true if the value is a function, false otherwise.
|
49 | */
|
50 | export declare function isFunction(val: unknown): val is Function;
|
51 | /**
|
52 | * Returns the unique items in the array.
|
53 | *
|
54 | * @param {Array<T>}
|
55 | * The array to remove dupes from.
|
56 | *
|
57 | * @return {Array<T>}
|
58 | * The deduped array.
|
59 | */
|
60 | export declare function uniq<T>(arr: Array<T>): Array<T>;
|