@oscarpalmer/atoms 0.77.0 → 0.77.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js/array/chunk.cjs +1 -1
- package/dist/js/array/chunk.js +1 -1
- package/dist/js/value/equal.cjs +4 -1
- package/dist/js/value/equal.js +4 -1
- package/package.json +1 -1
- package/src/js/array/chunk.ts +1 -1
- package/src/js/array/count.ts +6 -6
- package/src/js/array/exists.ts +6 -6
- package/src/js/array/filter.ts +6 -6
- package/src/js/array/find.ts +6 -6
- package/src/js/array/group-by.ts +67 -55
- package/src/js/array/index-of.ts +6 -6
- package/src/js/array/sort.ts +20 -0
- package/src/js/array/to-map.ts +55 -47
- package/src/js/array/to-record.ts +61 -57
- package/src/js/array/unique.ts +6 -6
- package/src/js/internal/value/handle.ts +5 -5
- package/src/js/value/clone.ts +3 -1
- package/src/js/value/equal.ts +4 -1
- package/src/js/value/get.ts +9 -9
- package/src/js/value/set.ts +10 -11
- package/types/array/count.d.cts +34 -2
- package/types/array/count.d.ts +3 -3
- package/types/array/exists.d.cts +34 -2
- package/types/array/exists.d.ts +3 -3
- package/types/array/filter.d.cts +34 -2
- package/types/array/filter.d.ts +3 -3
- package/types/array/find.d.cts +34 -2
- package/types/array/find.d.ts +3 -3
- package/types/array/group-by.d.cts +44 -12
- package/types/array/group-by.d.ts +14 -14
- package/types/array/index-of.d.cts +34 -2
- package/types/array/index-of.d.ts +3 -3
- package/types/array/index.d.cts +88 -46
- package/types/array/sort.d.cts +42 -0
- package/types/array/sort.d.ts +11 -1
- package/types/array/to-map.d.cts +42 -10
- package/types/array/to-map.d.ts +13 -13
- package/types/array/to-record.d.cts +44 -12
- package/types/array/to-record.d.ts +13 -13
- package/types/array/unique.d.cts +34 -2
- package/types/array/unique.d.ts +3 -3
- package/types/index.d.cts +1034 -317
- package/types/internal/value/handle.d.cts +27 -2
- package/types/internal/value/handle.d.ts +2 -2
- package/types/models.d.cts +467 -210
- package/types/value/clone.d.cts +1 -1
- package/types/value/clone.d.ts +1 -1
- package/types/value/get.d.cts +470 -211
- package/types/value/get.d.ts +3 -3
- package/types/value/index.d.cts +515 -224
- package/types/value/set.d.cts +357 -170
- package/types/value/set.d.ts +3 -3
- package/types/value/smush.d.cts +463 -209
package/types/array/find.d.cts
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
Represents an object with `unknown` value. You probably want this instead of `{}`.
|
|
5
|
+
|
|
6
|
+
Use case: You have an object whose keys and values are unknown to you.
|
|
7
|
+
|
|
8
|
+
@example
|
|
9
|
+
```
|
|
10
|
+
import type {UnknownRecord} from 'type-fest';
|
|
11
|
+
|
|
12
|
+
function toJson(object: UnknownRecord) {
|
|
13
|
+
return JSON.stringify(object);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
toJson({hello: 'world'});
|
|
17
|
+
//=> '{"hello":"world"}'
|
|
18
|
+
|
|
19
|
+
function isObject(value: unknown): value is UnknownRecord {
|
|
20
|
+
return typeof value === 'object' && value !== null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
isObject({hello: 'world'});
|
|
24
|
+
//=> true
|
|
25
|
+
|
|
26
|
+
isObject('hello');
|
|
27
|
+
//=> false
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
@category Type
|
|
31
|
+
@category Object
|
|
32
|
+
*/
|
|
33
|
+
export type UnknownRecord = Record<PropertyKey, unknown>;
|
|
3
34
|
export type Key = number | string;
|
|
35
|
+
export type PlainObject = UnknownRecord;
|
|
4
36
|
/**
|
|
5
37
|
* Get the first item matching `value` _(or `undefined` if no match is found)_
|
|
6
38
|
*/
|
|
@@ -13,11 +45,11 @@ export declare function find<Item>(array: Item[], matches: (item: Item, index: n
|
|
|
13
45
|
* - Get the first matching item _(or `undefined` if no match is found)_
|
|
14
46
|
* - Use `key` to find a comparison value to match with `value`
|
|
15
47
|
*/
|
|
16
|
-
export declare function find<Item,
|
|
48
|
+
export declare function find<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): Item | undefined;
|
|
17
49
|
/**
|
|
18
50
|
* - Get the first matching item _(or `undefined` if no match is found)_
|
|
19
51
|
* - Use `key` to find a comparison value to match with `value`
|
|
20
52
|
*/
|
|
21
|
-
export declare function find<Item,
|
|
53
|
+
export declare function find<Item, ItemKey extends (item: Item, index: number, array: Item[]) => Key>(array: Item[], key: ItemKey, value: ReturnType<ItemKey>): Item | undefined;
|
|
22
54
|
|
|
23
55
|
export {};
|
package/types/array/find.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Key
|
|
1
|
+
import type { Key, PlainObject } from '~/models';
|
|
2
2
|
/**
|
|
3
3
|
* Get the first item matching `value` _(or `undefined` if no match is found)_
|
|
4
4
|
*/
|
|
@@ -11,9 +11,9 @@ export declare function find<Item>(array: Item[], matches: (item: Item, index: n
|
|
|
11
11
|
* - Get the first matching item _(or `undefined` if no match is found)_
|
|
12
12
|
* - Use `key` to find a comparison value to match with `value`
|
|
13
13
|
*/
|
|
14
|
-
export declare function find<Item,
|
|
14
|
+
export declare function find<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): Item | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* - Get the first matching item _(or `undefined` if no match is found)_
|
|
17
17
|
* - Use `key` to find a comparison value to match with `value`
|
|
18
18
|
*/
|
|
19
|
-
export declare function find<Item,
|
|
19
|
+
export declare function find<Item, ItemKey extends (item: Item, index: number, array: Item[]) => Key>(array: Item[], key: ItemKey, value: ReturnType<ItemKey>): Item | undefined;
|
|
@@ -1,55 +1,87 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
Represents an object with `unknown` value. You probably want this instead of `{}`.
|
|
5
|
+
|
|
6
|
+
Use case: You have an object whose keys and values are unknown to you.
|
|
7
|
+
|
|
8
|
+
@example
|
|
9
|
+
```
|
|
10
|
+
import type {UnknownRecord} from 'type-fest';
|
|
11
|
+
|
|
12
|
+
function toJson(object: UnknownRecord) {
|
|
13
|
+
return JSON.stringify(object);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
toJson({hello: 'world'});
|
|
17
|
+
//=> '{"hello":"world"}'
|
|
18
|
+
|
|
19
|
+
function isObject(value: unknown): value is UnknownRecord {
|
|
20
|
+
return typeof value === 'object' && value !== null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
isObject({hello: 'world'});
|
|
24
|
+
//=> true
|
|
25
|
+
|
|
26
|
+
isObject('hello');
|
|
27
|
+
//=> false
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
@category Type
|
|
31
|
+
@category Object
|
|
32
|
+
*/
|
|
33
|
+
export type UnknownRecord = Record<PropertyKey, unknown>;
|
|
3
34
|
export type KeyedValue<Item, Key extends keyof Item> = Item[Key] extends PropertyKey ? Item[Key] : never;
|
|
4
35
|
export type Key = number | string;
|
|
36
|
+
export type PlainObject = UnknownRecord;
|
|
5
37
|
/**
|
|
6
38
|
* Create a record from an array of items using a specific key
|
|
7
39
|
*/
|
|
8
|
-
export declare function groupBy<Item,
|
|
40
|
+
export declare function groupBy<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey): Record<KeyedValue<Item, ItemKey>, Item>;
|
|
9
41
|
/**
|
|
10
42
|
* Create a record from an array of items using a specific key, and grouping them into arrays
|
|
11
43
|
*/
|
|
12
|
-
export declare function groupBy<Item,
|
|
44
|
+
export declare function groupBy<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, arrays: true): Record<KeyedValue<Item, ItemKey>, Item[]>;
|
|
13
45
|
/**
|
|
14
46
|
* Create a record from an array of items using a specific key
|
|
15
47
|
*/
|
|
16
|
-
export declare function groupBy<Item,
|
|
48
|
+
export declare function groupBy<Item, ItemKey extends (item: Item, index: number, array: Item[]) => Key>(array: Item[], key: ItemKey): Record<ReturnType<ItemKey>, Item>;
|
|
17
49
|
/**
|
|
18
50
|
* Create a record from an array of items using a specific key, and grouping them into arrays
|
|
19
51
|
*/
|
|
20
|
-
export declare function groupBy<Item,
|
|
52
|
+
export declare function groupBy<Item, ItemKey extends (item: Item, index: number, array: Item[]) => Key>(array: Item[], key: ItemKey, arrays: true): Record<ReturnType<ItemKey>, Item[]>;
|
|
21
53
|
/**
|
|
22
54
|
* Create a record from an array of items using a specific key and value
|
|
23
55
|
*/
|
|
24
|
-
export declare function groupBy<Item,
|
|
56
|
+
export declare function groupBy<Item extends PlainObject, ItemKey extends keyof Item, ItemValue extends keyof Item>(array: Item[], key: ItemKey, value: ItemValue): Record<KeyedValue<Item, ItemKey>, KeyedValue<Item, ItemValue>>;
|
|
25
57
|
/**
|
|
26
58
|
* Create a record from an array of items using a specific key and value, and grouping them into arrays
|
|
27
59
|
*/
|
|
28
|
-
export declare function groupBy<Item,
|
|
60
|
+
export declare function groupBy<Item extends PlainObject, ItemKey extends keyof Item, ItemValue extends keyof Item>(array: Item[], key: ItemKey, value: ItemValue, arrays: true): Record<KeyedValue<Item, ItemKey>, Array<KeyedValue<Item, ItemValue>>>;
|
|
29
61
|
/**
|
|
30
62
|
* Create a record from an array of items using a specific key and value
|
|
31
63
|
*/
|
|
32
|
-
export declare function groupBy<Item,
|
|
64
|
+
export declare function groupBy<Item extends PlainObject, ItemKey extends keyof Item, ItemValue extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], key: ItemKey, value: ItemValue): Record<KeyedValue<Item, ItemKey>, ReturnType<ItemValue>>;
|
|
33
65
|
/**
|
|
34
66
|
* Create a record from an array of items using a specific key and value, and grouping them into arrays
|
|
35
67
|
*/
|
|
36
|
-
export declare function groupBy<Item,
|
|
68
|
+
export declare function groupBy<Item extends PlainObject, ItemKey extends keyof Item, ItemValue extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], key: ItemKey, value: ItemValue, arrays: true): Record<KeyedValue<Item, ItemKey>, Array<ReturnType<ItemValue>>>;
|
|
37
69
|
/**
|
|
38
70
|
* Create a record from an array of items using a specific key and value
|
|
39
71
|
*/
|
|
40
|
-
export declare function groupBy<Item,
|
|
72
|
+
export declare function groupBy<Item extends PlainObject, ItemKey extends (item: Item, index: number, array: Item[]) => Key, ItemValue extends keyof Item>(array: Item[], key: ItemKey, value: ItemValue): Record<ReturnType<ItemKey>, KeyedValue<Item, ItemValue>>;
|
|
41
73
|
/**
|
|
42
74
|
* Create a record from an array of items using a specific key and value, and grouping them into arrays
|
|
43
75
|
*/
|
|
44
|
-
export declare function groupBy<Item,
|
|
76
|
+
export declare function groupBy<Item extends PlainObject, ItemKey extends (item: Item, index: number, array: Item[]) => Key, ItemValue extends keyof Item>(array: Item[], key: ItemKey, value: ItemValue, arrays: true): Record<ReturnType<ItemKey>, Array<KeyedValue<Item, ItemValue>>>;
|
|
45
77
|
/**
|
|
46
78
|
* Create a record from an array of items using a specific key and value
|
|
47
79
|
*/
|
|
48
|
-
export declare function groupBy<Item,
|
|
80
|
+
export declare function groupBy<Item, ItemKey extends (item: Item, index: number, array: Item[]) => Key, ItemValue extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], key: ItemKey, value: ItemValue): Record<ReturnType<ItemKey>, ReturnType<ItemValue>>;
|
|
49
81
|
/**
|
|
50
82
|
* Create a record from an array of items using a specific key and value, and grouping them into arrays
|
|
51
83
|
*/
|
|
52
|
-
export declare function groupBy<Item,
|
|
84
|
+
export declare function groupBy<Item, ItemKey extends (item: Item, index: number, array: Item[]) => Key, ItemValue extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], key: ItemKey, value: ItemValue, arrays: true): Record<ReturnType<ItemKey>, Array<ReturnType<ItemValue>>>;
|
|
53
85
|
export declare function groupValues(array: unknown[], key: unknown, value: unknown, arrays: boolean): Record<Key, unknown>;
|
|
54
86
|
|
|
55
87
|
export {};
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import type { Key
|
|
1
|
+
import type { Key, KeyedValue, PlainObject } from '~/models';
|
|
2
2
|
/**
|
|
3
3
|
* Create a record from an array of items using a specific key
|
|
4
4
|
*/
|
|
5
|
-
export declare function groupBy<Item,
|
|
5
|
+
export declare function groupBy<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey): Record<KeyedValue<Item, ItemKey>, Item>;
|
|
6
6
|
/**
|
|
7
7
|
* Create a record from an array of items using a specific key, and grouping them into arrays
|
|
8
8
|
*/
|
|
9
|
-
export declare function groupBy<Item,
|
|
9
|
+
export declare function groupBy<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, arrays: true): Record<KeyedValue<Item, ItemKey>, Item[]>;
|
|
10
10
|
/**
|
|
11
11
|
* Create a record from an array of items using a specific key
|
|
12
12
|
*/
|
|
13
|
-
export declare function groupBy<Item,
|
|
13
|
+
export declare function groupBy<Item, ItemKey extends (item: Item, index: number, array: Item[]) => Key>(array: Item[], key: ItemKey): Record<ReturnType<ItemKey>, Item>;
|
|
14
14
|
/**
|
|
15
15
|
* Create a record from an array of items using a specific key, and grouping them into arrays
|
|
16
16
|
*/
|
|
17
|
-
export declare function groupBy<Item,
|
|
17
|
+
export declare function groupBy<Item, ItemKey extends (item: Item, index: number, array: Item[]) => Key>(array: Item[], key: ItemKey, arrays: true): Record<ReturnType<ItemKey>, Item[]>;
|
|
18
18
|
/**
|
|
19
19
|
* Create a record from an array of items using a specific key and value
|
|
20
20
|
*/
|
|
21
|
-
export declare function groupBy<Item,
|
|
21
|
+
export declare function groupBy<Item extends PlainObject, ItemKey extends keyof Item, ItemValue extends keyof Item>(array: Item[], key: ItemKey, value: ItemValue): Record<KeyedValue<Item, ItemKey>, KeyedValue<Item, ItemValue>>;
|
|
22
22
|
/**
|
|
23
23
|
* Create a record from an array of items using a specific key and value, and grouping them into arrays
|
|
24
24
|
*/
|
|
25
|
-
export declare function groupBy<Item,
|
|
25
|
+
export declare function groupBy<Item extends PlainObject, ItemKey extends keyof Item, ItemValue extends keyof Item>(array: Item[], key: ItemKey, value: ItemValue, arrays: true): Record<KeyedValue<Item, ItemKey>, Array<KeyedValue<Item, ItemValue>>>;
|
|
26
26
|
/**
|
|
27
27
|
* Create a record from an array of items using a specific key and value
|
|
28
28
|
*/
|
|
29
|
-
export declare function groupBy<Item,
|
|
29
|
+
export declare function groupBy<Item extends PlainObject, ItemKey extends keyof Item, ItemValue extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], key: ItemKey, value: ItemValue): Record<KeyedValue<Item, ItemKey>, ReturnType<ItemValue>>;
|
|
30
30
|
/**
|
|
31
31
|
* Create a record from an array of items using a specific key and value, and grouping them into arrays
|
|
32
32
|
*/
|
|
33
|
-
export declare function groupBy<Item,
|
|
33
|
+
export declare function groupBy<Item extends PlainObject, ItemKey extends keyof Item, ItemValue extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], key: ItemKey, value: ItemValue, arrays: true): Record<KeyedValue<Item, ItemKey>, Array<ReturnType<ItemValue>>>;
|
|
34
34
|
/**
|
|
35
35
|
* Create a record from an array of items using a specific key and value
|
|
36
36
|
*/
|
|
37
|
-
export declare function groupBy<Item,
|
|
37
|
+
export declare function groupBy<Item extends PlainObject, ItemKey extends (item: Item, index: number, array: Item[]) => Key, ItemValue extends keyof Item>(array: Item[], key: ItemKey, value: ItemValue): Record<ReturnType<ItemKey>, KeyedValue<Item, ItemValue>>;
|
|
38
38
|
/**
|
|
39
39
|
* Create a record from an array of items using a specific key and value, and grouping them into arrays
|
|
40
40
|
*/
|
|
41
|
-
export declare function groupBy<Item,
|
|
41
|
+
export declare function groupBy<Item extends PlainObject, ItemKey extends (item: Item, index: number, array: Item[]) => Key, ItemValue extends keyof Item>(array: Item[], key: ItemKey, value: ItemValue, arrays: true): Record<ReturnType<ItemKey>, Array<KeyedValue<Item, ItemValue>>>;
|
|
42
42
|
/**
|
|
43
43
|
* Create a record from an array of items using a specific key and value
|
|
44
44
|
*/
|
|
45
|
-
export declare function groupBy<Item,
|
|
45
|
+
export declare function groupBy<Item, ItemKey extends (item: Item, index: number, array: Item[]) => Key, ItemValue extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], key: ItemKey, value: ItemValue): Record<ReturnType<ItemKey>, ReturnType<ItemValue>>;
|
|
46
46
|
/**
|
|
47
47
|
* Create a record from an array of items using a specific key and value, and grouping them into arrays
|
|
48
48
|
*/
|
|
49
|
-
export declare function groupBy<Item,
|
|
50
|
-
export declare function groupValues(array: unknown[], key: unknown, value: unknown, arrays: boolean): Record<
|
|
49
|
+
export declare function groupBy<Item, ItemKey extends (item: Item, index: number, array: Item[]) => Key, ItemValue extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], key: ItemKey, value: ItemValue, arrays: true): Record<ReturnType<ItemKey>, Array<ReturnType<ItemValue>>>;
|
|
50
|
+
export declare function groupValues(array: unknown[], key: unknown, value: unknown, arrays: boolean): Record<Key, unknown>;
|
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
Represents an object with `unknown` value. You probably want this instead of `{}`.
|
|
5
|
+
|
|
6
|
+
Use case: You have an object whose keys and values are unknown to you.
|
|
7
|
+
|
|
8
|
+
@example
|
|
9
|
+
```
|
|
10
|
+
import type {UnknownRecord} from 'type-fest';
|
|
11
|
+
|
|
12
|
+
function toJson(object: UnknownRecord) {
|
|
13
|
+
return JSON.stringify(object);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
toJson({hello: 'world'});
|
|
17
|
+
//=> '{"hello":"world"}'
|
|
18
|
+
|
|
19
|
+
function isObject(value: unknown): value is UnknownRecord {
|
|
20
|
+
return typeof value === 'object' && value !== null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
isObject({hello: 'world'});
|
|
24
|
+
//=> true
|
|
25
|
+
|
|
26
|
+
isObject('hello');
|
|
27
|
+
//=> false
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
@category Type
|
|
31
|
+
@category Object
|
|
32
|
+
*/
|
|
33
|
+
export type UnknownRecord = Record<PropertyKey, unknown>;
|
|
3
34
|
export type Key = number | string;
|
|
35
|
+
export type PlainObject = UnknownRecord;
|
|
4
36
|
/**
|
|
5
37
|
* Get the index for the first item matching `value` _(or `-1` if no match is found)_
|
|
6
38
|
*/
|
|
@@ -13,11 +45,11 @@ export declare function indexOf<Item>(array: Item[], matches: (item: Item, index
|
|
|
13
45
|
* - Get the index for the first matching item _(or `-1` if no match is found)_
|
|
14
46
|
* - Use `key` to find a comparison value to match with `value`
|
|
15
47
|
*/
|
|
16
|
-
export declare function indexOf<Item,
|
|
48
|
+
export declare function indexOf<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): number;
|
|
17
49
|
/**
|
|
18
50
|
* - Get the index for the first matching item _(or `-1` if no match is found)_
|
|
19
51
|
* - Use `key` to find a comparison value to match with `value`
|
|
20
52
|
*/
|
|
21
|
-
export declare function indexOf<Item,
|
|
53
|
+
export declare function indexOf<Item, ItemKey extends (item: Item, index: number, array: Item[]) => Key>(array: Item[], key: ItemKey, value: ReturnType<ItemKey>): number;
|
|
22
54
|
|
|
23
55
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Key
|
|
1
|
+
import type { Key, PlainObject } from '~/models';
|
|
2
2
|
/**
|
|
3
3
|
* Get the index for the first item matching `value` _(or `-1` if no match is found)_
|
|
4
4
|
*/
|
|
@@ -11,9 +11,9 @@ export declare function indexOf<Item>(array: Item[], matches: (item: Item, index
|
|
|
11
11
|
* - Get the index for the first matching item _(or `-1` if no match is found)_
|
|
12
12
|
* - Use `key` to find a comparison value to match with `value`
|
|
13
13
|
*/
|
|
14
|
-
export declare function indexOf<Item,
|
|
14
|
+
export declare function indexOf<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): number;
|
|
15
15
|
/**
|
|
16
16
|
* - Get the index for the first matching item _(or `-1` if no match is found)_
|
|
17
17
|
* - Use `key` to find a comparison value to match with `value`
|
|
18
18
|
*/
|
|
19
|
-
export declare function indexOf<Item,
|
|
19
|
+
export declare function indexOf<Item, ItemKey extends (item: Item, index: number, array: Item[]) => Key>(array: Item[], key: ItemKey, value: ReturnType<ItemKey>): number;
|