@oscarpalmer/atoms 0.76.0 → 0.77.0
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/count.cjs +1 -8
- package/dist/js/array/count.js +1 -8
- package/dist/js/array/exists.cjs +1 -8
- package/dist/js/array/exists.js +1 -8
- package/dist/js/array/filter.cjs +1 -8
- package/dist/js/array/filter.js +1 -8
- package/dist/js/array/find.cjs +1 -8
- package/dist/js/array/find.js +1 -8
- package/dist/js/array/index-of.cjs +1 -8
- package/dist/js/array/index-of.js +1 -8
- package/dist/js/array/unique.cjs +1 -1
- package/dist/js/array/unique.js +1 -1
- package/dist/js/internal/array/find.cjs +12 -2
- package/dist/js/internal/array/find.js +12 -2
- package/package.json +11 -4
- package/src/js/array/count.ts +7 -20
- package/src/js/array/exists.ts +7 -22
- package/src/js/array/filter.ts +7 -20
- package/src/js/array/find.ts +7 -20
- package/src/js/array/group-by.ts +19 -21
- package/src/js/array/index-of.ts +7 -20
- package/src/js/array/models.ts +2 -16
- package/src/js/array/sort.ts +3 -7
- package/src/js/array/to-map.ts +19 -21
- package/src/js/array/to-record.ts +17 -19
- package/src/js/array/unique.ts +8 -8
- package/src/js/internal/array/callbacks.ts +4 -4
- package/src/js/internal/array/find.ts +29 -6
- package/types/array/count.d.cts +2 -5
- package/types/array/count.d.ts +3 -3
- package/types/array/exists.d.cts +2 -5
- package/types/array/exists.d.ts +3 -3
- package/types/array/filter.d.cts +2 -5
- package/types/array/filter.d.ts +3 -3
- package/types/array/find.d.cts +2 -5
- package/types/array/find.d.ts +3 -3
- package/types/array/group-by.d.cts +8 -11
- package/types/array/group-by.d.ts +10 -11
- package/types/array/index-of.d.cts +2 -5
- package/types/array/index-of.d.ts +3 -3
- package/types/array/index.d.cts +43 -48
- package/types/array/models.d.cts +2 -7
- package/types/array/models.d.ts +2 -7
- package/types/array/sort.d.cts +3 -4
- package/types/array/sort.d.ts +3 -3
- package/types/array/to-map.d.cts +8 -11
- package/types/array/to-map.d.ts +9 -10
- package/types/array/to-record.d.cts +8 -11
- package/types/array/to-record.d.ts +9 -10
- package/types/array/unique.d.cts +3 -5
- package/types/array/unique.d.ts +4 -4
- package/types/index.d.cts +321 -1019
- package/types/internal/array/find.d.cts +2 -2
- package/types/internal/array/find.d.ts +2 -2
- package/types/models.d.cts +210 -467
- package/types/value/get.d.cts +210 -469
- package/types/value/index.d.cts +223 -514
- package/types/value/set.d.cts +169 -356
- package/types/value/smush.d.cts +209 -463
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { KeyedValue } from '~/models';
|
|
1
|
+
import type { KeyedValue, Key as SimpleKey } from '~/models';
|
|
3
2
|
/**
|
|
4
3
|
* Create a record from an array of items _(using their indices as keys)_
|
|
5
4
|
*/
|
|
@@ -15,11 +14,11 @@ export declare function toRecord<Item, Key extends keyof Item>(array: Item[], ke
|
|
|
15
14
|
/**
|
|
16
15
|
* Create a record from an array of items using a specific key
|
|
17
16
|
*/
|
|
18
|
-
export declare function toRecord<Item, Key extends
|
|
17
|
+
export declare function toRecord<Item, Key extends (item: Item, index: number, array: Item[]) => SimpleKey>(array: Item[], key: Key): Record<ReturnType<Key>, Item>;
|
|
19
18
|
/**
|
|
20
19
|
* Create a record from an array of items using a specific key, and grouping them into arrays
|
|
21
20
|
*/
|
|
22
|
-
export declare function toRecord<Item, Key extends
|
|
21
|
+
export declare function toRecord<Item, Key extends (item: Item, index: number, array: Item[]) => SimpleKey>(array: Item[], key: Key, arrays: true): Record<ReturnType<Key>, Item[]>;
|
|
23
22
|
/**
|
|
24
23
|
* Create a record from an array of items using a specific key and value
|
|
25
24
|
*/
|
|
@@ -31,24 +30,24 @@ export declare function toRecord<Item, Key extends keyof Item, Value extends key
|
|
|
31
30
|
/**
|
|
32
31
|
* Create a record from an array of items using a specific key and value
|
|
33
32
|
*/
|
|
34
|
-
export declare function toRecord<Item, Key extends keyof Item, Value extends
|
|
33
|
+
export declare function toRecord<Item, Key extends keyof Item, Value extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], key: Key, value: Value): Record<KeyedValue<Item, Key>, ReturnType<Value>>;
|
|
35
34
|
/**
|
|
36
35
|
* Create a record from an array of items using a specific key and value, and grouping them into arrays
|
|
37
36
|
*/
|
|
38
|
-
export declare function toRecord<Item, Key extends keyof Item, Value extends
|
|
37
|
+
export declare function toRecord<Item, Key extends keyof Item, Value extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], key: Key, value: Value, arrays: true): Record<KeyedValue<Item, Key>, Array<ReturnType<Value>>>;
|
|
39
38
|
/**
|
|
40
39
|
* Create a record from an array of items using a specific key and value
|
|
41
40
|
*/
|
|
42
|
-
export declare function toRecord<Item, Key extends
|
|
41
|
+
export declare function toRecord<Item, Key extends (item: Item, index: number, array: Item[]) => SimpleKey, Value extends keyof Item>(array: Item[], key: Key, value: Value): Record<ReturnType<Key>, KeyedValue<Item, Value>>;
|
|
43
42
|
/**
|
|
44
43
|
* Create a record from an array of items using a specific key and value, and grouping them into arrays
|
|
45
44
|
*/
|
|
46
|
-
export declare function toRecord<Item, Key extends
|
|
45
|
+
export declare function toRecord<Item, Key extends (item: Item, index: number, array: Item[]) => SimpleKey, Value extends keyof Item>(array: Item[], key: Key, value: Value, arrays: true): Record<ReturnType<Key>, Array<KeyedValue<Item, Value>>>;
|
|
47
46
|
/**
|
|
48
47
|
* Create a record from an array of items using a specific key and value
|
|
49
48
|
*/
|
|
50
|
-
export declare function toRecord<Item, Key extends
|
|
49
|
+
export declare function toRecord<Item, Key extends (item: Item, index: number, array: Item[]) => SimpleKey, Value extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], key: Key, value: Value): Record<ReturnType<Key>, ReturnType<Value>>;
|
|
51
50
|
/**
|
|
52
51
|
* Create a record from an array of items using a specific key and value, and grouping them into arrays
|
|
53
52
|
*/
|
|
54
|
-
export declare function toRecord<Item, Key extends
|
|
53
|
+
export declare function toRecord<Item, Key extends (item: Item, index: number, array: Item[]) => SimpleKey, Value extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], key: Key, value: Value, arrays: true): Record<ReturnType<Key>, Array<ReturnType<Value>>>;
|
package/types/array/unique.d.cts
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
3
|
export type Key = number | string;
|
|
4
|
-
export type ArrayCallback<Item, Value> = (item: Item, index: number, array: Item[]) => Value;
|
|
5
|
-
export type KeyCallback<Item> = ArrayCallback<Item, Key>;
|
|
6
4
|
/**
|
|
7
5
|
* Get an array of unique items
|
|
8
6
|
*/
|
|
9
7
|
export declare function unique<Item>(array: Item[]): Item[];
|
|
10
8
|
/**
|
|
11
9
|
* - Get an array of unique items
|
|
12
|
-
* - Use `key` to find a comparison value
|
|
10
|
+
* - Use `key` to find a comparison value for an item
|
|
13
11
|
*/
|
|
14
12
|
export declare function unique<Item, Key extends keyof Item>(array: Item[], key: Key): Item[];
|
|
15
13
|
/**
|
|
16
14
|
* - Get an array of unique items
|
|
17
|
-
* - Use `key` to find a comparison value
|
|
15
|
+
* - Use `key` to find a comparison value for an item
|
|
18
16
|
*/
|
|
19
|
-
export declare function unique<Item, Key extends
|
|
17
|
+
export declare function unique<Item, Key extends (item: Item, index: number, array: Item[]) => Key>(array: Item[], key: Key): Item[];
|
|
20
18
|
|
|
21
19
|
export {};
|
package/types/array/unique.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Key as SimpleKey } from '~/models';
|
|
2
2
|
/**
|
|
3
3
|
* Get an array of unique items
|
|
4
4
|
*/
|
|
5
5
|
export declare function unique<Item>(array: Item[]): Item[];
|
|
6
6
|
/**
|
|
7
7
|
* - Get an array of unique items
|
|
8
|
-
* - Use `key` to find a comparison value
|
|
8
|
+
* - Use `key` to find a comparison value for an item
|
|
9
9
|
*/
|
|
10
10
|
export declare function unique<Item, Key extends keyof Item>(array: Item[], key: Key): Item[];
|
|
11
11
|
/**
|
|
12
12
|
* - Get an array of unique items
|
|
13
|
-
* - Use `key` to find a comparison value
|
|
13
|
+
* - Use `key` to find a comparison value for an item
|
|
14
14
|
*/
|
|
15
|
-
export declare function unique<Item, Key extends
|
|
15
|
+
export declare function unique<Item, Key extends (item: Item, index: number, array: Item[]) => SimpleKey>(array: Item[], key: Key): Item[];
|