@oscarpalmer/atoms 0.202.0 → 0.204.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/array/difference.d.mts +4 -5
- package/dist/array/exists.d.mts +5 -6
- package/dist/array/filter.d.mts +10 -11
- package/dist/array/filter.mjs +0 -1
- package/dist/array/find.d.mts +10 -11
- package/dist/array/find.mjs +0 -1
- package/dist/array/first.d.mts +10 -11
- package/dist/array/first.mjs +0 -1
- package/dist/array/flatten.d.mts +2 -3
- package/dist/array/from.d.mts +7 -8
- package/dist/array/group-by.d.mts +7 -8
- package/dist/array/group-by.mjs +0 -1
- package/dist/array/insert.d.mts +3 -4
- package/dist/array/intersection.d.mts +4 -5
- package/dist/array/last.d.mts +10 -11
- package/dist/array/last.mjs +0 -1
- package/dist/array/move.d.mts +9 -10
- package/dist/array/move.mjs +0 -4
- package/dist/array/partition.d.mts +5 -6
- package/dist/array/push.d.mts +2 -3
- package/dist/array/reverse.d.mts +2 -3
- package/dist/array/select.d.mts +11 -12
- package/dist/array/select.mjs +0 -1
- package/dist/array/single.d.mts +4 -5
- package/dist/array/slice.d.mts +12 -13
- package/dist/array/sort.d.mts +31 -32
- package/dist/array/sort.mjs +38 -39
- package/dist/array/splice.d.mts +5 -6
- package/dist/array/swap.d.mts +8 -9
- package/dist/array/swap.mjs +0 -1
- package/dist/array/to-map.d.mts +7 -8
- package/dist/array/to-map.mjs +0 -1
- package/dist/array/to-record.d.mts +7 -8
- package/dist/array/to-record.mjs +0 -1
- package/dist/array/to-set.d.mts +4 -5
- package/dist/array/toggle.d.mts +4 -5
- package/dist/array/union.d.mts +4 -5
- package/dist/array/unique.d.mts +4 -5
- package/dist/array/update.d.mts +4 -5
- package/dist/beacon.d.mts +8 -9
- package/dist/beacon.mjs +96 -71
- package/dist/color/constants.d.mts +14 -13
- package/dist/color/constants.mjs +9 -2
- package/dist/color/index.d.mts +2 -2
- package/dist/color/instance.d.mts +3 -3
- package/dist/color/instance.mjs +91 -69
- package/dist/color/misc/alpha.d.mts +7 -6
- package/dist/color/misc/alpha.mjs +8 -2
- package/dist/color/misc/format.d.mts +6 -7
- package/dist/color/misc/format.mjs +15 -12
- package/dist/color/misc/get.d.mts +14 -15
- package/dist/color/misc/is.d.mts +16 -17
- package/dist/color/misc/is.mjs +7 -7
- package/dist/color/misc/state.d.mts +33 -10
- package/dist/color/misc/state.mjs +28 -48
- package/dist/color/models.d.mts +25 -19
- package/dist/color/space/hex.d.mts +14 -11
- package/dist/color/space/hex.mjs +21 -2
- package/dist/color/space/hsl.d.mts +13 -10
- package/dist/color/space/hsl.mjs +25 -4
- package/dist/color/space/hwb.d.mts +14 -11
- package/dist/color/space/hwb.mjs +24 -3
- package/dist/color/space/rgb.d.mts +16 -13
- package/dist/color/space/rgb.mjs +41 -20
- package/dist/function/limit.d.mts +9 -8
- package/dist/function/limit.mjs +5 -7
- package/dist/function/once.d.mts +26 -6
- package/dist/function/once.mjs +129 -76
- package/dist/function/retry.d.mts +5 -6
- package/dist/function/retry.mjs +3 -4
- package/dist/index.d.mts +184 -60
- package/dist/index.mjs +1292 -970
- package/dist/internal/aborter.d.mts +9 -0
- package/dist/internal/{abort.mjs → aborter.mjs} +1 -1
- package/dist/internal/array/callbacks.d.mts +4 -5
- package/dist/internal/array/chunk.d.mts +2 -3
- package/dist/internal/array/compact.d.mts +3 -4
- package/dist/internal/array/find.d.mts +10 -11
- package/dist/internal/array/get.d.mts +7 -8
- package/dist/internal/array/get.mjs +3 -2
- package/dist/internal/array/group.d.mts +2 -3
- package/dist/internal/array/index-of.d.mts +10 -11
- package/dist/internal/array/index-of.mjs +0 -1
- package/dist/internal/array/insert.d.mts +5 -6
- package/dist/internal/array/match.d.mts +17 -18
- package/dist/internal/array/overlap.d.mts +2 -3
- package/dist/internal/array/sets.d.mts +5 -6
- package/dist/internal/array/shuffle.d.mts +2 -3
- package/dist/internal/array/update.d.mts +2 -3
- package/dist/internal/defaults.d.mts +3 -4
- package/dist/internal/function/assert.d.mts +10 -11
- package/dist/internal/function/assert.mjs +0 -7
- package/dist/internal/function/limit.d.mts +41 -0
- package/dist/internal/function/limit.mjs +106 -0
- package/dist/internal/function/memoize.d.mts +4 -5
- package/dist/internal/function/memoize.mjs +55 -31
- package/dist/internal/function/misc.d.mts +2 -3
- package/dist/internal/function/work.d.mts +53 -54
- package/dist/internal/function/work.mjs +0 -2
- package/dist/internal/herald.d.mts +8 -9
- package/dist/internal/herald.mjs +38 -27
- package/dist/internal/is.d.mts +19 -20
- package/dist/internal/math/aggregate.d.mts +14 -15
- package/dist/internal/math/misc.d.mts +3 -4
- package/dist/internal/number.d.mts +4 -5
- package/dist/internal/random.d.mts +3 -4
- package/dist/internal/result/misc.d.mts +29 -14
- package/dist/internal/result/misc.mjs +4 -3
- package/dist/internal/result/models.d.mts +9 -10
- package/dist/internal/sized/map.d.mts +2 -3
- package/dist/internal/sized/misc.d.mts +2 -3
- package/dist/internal/string/case.d.mts +9 -10
- package/dist/internal/string/misc.d.mts +8 -9
- package/dist/internal/subscription.d.mts +10 -11
- package/dist/internal/subscription.mjs +72 -58
- package/dist/internal/value/compare.d.mts +17 -9
- package/dist/internal/value/compare.mjs +6 -11
- package/dist/internal/value/equal.d.mts +34 -15
- package/dist/internal/value/equal.mjs +20 -13
- package/dist/internal/value/get.d.mts +3 -4
- package/dist/internal/value/handlers.d.mts +19 -9
- package/dist/internal/value/handlers.mjs +48 -50
- package/dist/internal/value/has.d.mts +6 -7
- package/dist/internal/value/has.mjs +0 -1
- package/dist/internal/value/misc.d.mts +6 -7
- package/dist/internal/value/misc.mjs +4 -3
- package/dist/internal/value/partial.d.mts +3 -4
- package/dist/internal/value/partial.mjs +2 -1
- package/dist/internal/value/set.d.mts +4 -5
- package/dist/internal/value/set.mjs +2 -1
- package/dist/is.d.mts +13 -13
- package/dist/logger.d.mts +5 -4
- package/dist/logger.mjs +72 -64
- package/dist/math.d.mts +20 -20
- package/dist/models.d.mts +45 -49
- package/dist/promise/constants.d.mts +14 -15
- package/dist/promise/delay.d.mts +3 -4
- package/dist/promise/delay.mjs +5 -5
- package/dist/promise/helpers.d.mts +7 -8
- package/dist/promise/helpers.mjs +4 -3
- package/dist/promise/index.d.mts +13 -14
- package/dist/promise/index.mjs +1 -2
- package/dist/promise/misc.d.mts +7 -7
- package/dist/promise/models.d.mts +17 -18
- package/dist/promise/timed.d.mts +4 -5
- package/dist/promise/timed.mjs +6 -6
- package/dist/query.d.mts +3 -4
- package/dist/queue.d.mts +14 -15
- package/dist/queue.mjs +198 -136
- package/dist/random.d.mts +8 -8
- package/dist/result/index.d.mts +8 -9
- package/dist/result/index.mjs +0 -1
- package/dist/result/match.d.mts +6 -7
- package/dist/result/match.mjs +0 -1
- package/dist/result/misc.d.mts +3 -3
- package/dist/result/work/flow.d.mts +28 -29
- package/dist/result/work/flow.mjs +0 -1
- package/dist/result/work/pipe.d.mts +24 -25
- package/dist/result/work/pipe.mjs +0 -1
- package/dist/sized/set.d.mts +2 -3
- package/dist/string/fuzzy.d.mts +21 -12
- package/dist/string/fuzzy.mjs +77 -52
- package/dist/string/index.d.mts +8 -8
- package/dist/string/match.d.mts +4 -5
- package/dist/string/normalize.d.mts +8 -9
- package/dist/string/normalize.mjs +9 -5
- package/dist/string/template.d.mts +9 -9
- package/dist/string/template.mjs +11 -5
- package/dist/value/clone.d.mts +21 -13
- package/dist/value/clone.mjs +19 -25
- package/dist/value/collection.d.mts +4 -5
- package/dist/value/diff.d.mts +5 -6
- package/dist/value/freeze.d.mts +18 -19
- package/dist/value/freeze.mjs +1 -5
- package/dist/value/merge.d.mts +13 -14
- package/dist/value/merge.mjs +21 -7
- package/dist/value/omit.d.mts +2 -3
- package/dist/value/pick.d.mts +2 -3
- package/dist/value/shake.d.mts +3 -4
- package/dist/value/smush.d.mts +3 -4
- package/dist/value/transform.d.mts +15 -10
- package/dist/value/transform.mjs +12 -8
- package/dist/value/unsmush.d.mts +3 -4
- package/package.json +2 -2
- package/dist/internal/abort.d.mts +0 -10
- package/dist/internal/function/timer.d.mts +0 -10
- package/dist/internal/function/timer.mjs +0 -87
|
@@ -17,7 +17,7 @@ import { PlainObject } from "../models.mjs";
|
|
|
17
17
|
* ); // => [{id: 1}, {id: 3}]
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
declare function difference<First, Second>(first: First[], second: Second[], callback: (item: First | Second) => unknown): First[];
|
|
20
|
+
export declare function difference<First, Second>(first: First[], second: Second[], callback: (item: First | Second) => unknown): First[];
|
|
21
21
|
/**
|
|
22
22
|
* Get the items from the first array that are not in the second array
|
|
23
23
|
*
|
|
@@ -35,7 +35,7 @@ declare function difference<First, Second>(first: First[], second: Second[], cal
|
|
|
35
35
|
* ); // => [{id: 1}, {id: 3}]
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
declare function difference<First extends PlainObject, Second extends PlainObject, SharedKey extends keyof First & keyof Second>(first: First[], second: Second[], key: SharedKey): First[];
|
|
38
|
+
export declare function difference<First extends PlainObject, Second extends PlainObject, SharedKey extends keyof First & keyof Second>(first: First[], second: Second[], key: SharedKey): First[];
|
|
39
39
|
/**
|
|
40
40
|
* Get the items from the first array that are not in the second array
|
|
41
41
|
*
|
|
@@ -51,6 +51,5 @@ declare function difference<First extends PlainObject, Second extends PlainObjec
|
|
|
51
51
|
* ); // => [1, 3]
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
|
-
declare function difference<First, Second>(first: First[], second: Second[]): First[];
|
|
55
|
-
//#endregion
|
|
56
|
-
export { difference };
|
|
54
|
+
export declare function difference<First, Second>(first: First[], second: Second[]): First[];
|
|
55
|
+
//#endregion
|
package/dist/array/exists.d.mts
CHANGED
|
@@ -17,7 +17,7 @@ import { PlainObject } from "../models.mjs";
|
|
|
17
17
|
* ); // => true
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
declare function exists<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], callback: Callback, value: ReturnType<Callback>): boolean;
|
|
20
|
+
export declare function exists<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], callback: Callback, value: ReturnType<Callback>): boolean;
|
|
21
21
|
/**
|
|
22
22
|
* Does an item with a specific value exist in the array?
|
|
23
23
|
*
|
|
@@ -35,7 +35,7 @@ declare function exists<Item, Callback extends (item: Item, index: number, array
|
|
|
35
35
|
* ); // => true
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
declare function exists<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): boolean;
|
|
38
|
+
export declare function exists<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): boolean;
|
|
39
39
|
/**
|
|
40
40
|
* Does an item in the array match the filter?
|
|
41
41
|
*
|
|
@@ -51,7 +51,7 @@ declare function exists<Item extends PlainObject, ItemKey extends keyof Item>(ar
|
|
|
51
51
|
* ); // => true
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
|
-
declare function exists<Item>(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): boolean;
|
|
54
|
+
export declare function exists<Item>(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): boolean;
|
|
55
55
|
/**
|
|
56
56
|
* Does the item exist in the array?
|
|
57
57
|
*
|
|
@@ -64,6 +64,5 @@ declare function exists<Item>(array: Item[], filter: (item: Item, index: number,
|
|
|
64
64
|
* exists([1, 2, 3], 2); // => true
|
|
65
65
|
* ```
|
|
66
66
|
*/
|
|
67
|
-
declare function exists<Item>(array: Item[], item: Item): boolean;
|
|
68
|
-
//#endregion
|
|
69
|
-
export { exists };
|
|
67
|
+
export declare function exists<Item>(array: Item[], item: Item): boolean;
|
|
68
|
+
//#endregion
|
package/dist/array/filter.d.mts
CHANGED
|
@@ -19,7 +19,7 @@ import { PlainObject } from "../models.mjs";
|
|
|
19
19
|
* ); // => [{id: 1}, {id: 3}]
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
declare function exclude<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], callback: Callback, value: ReturnType<Callback>): unknown[];
|
|
22
|
+
export declare function exclude<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], callback: Callback, value: ReturnType<Callback>): unknown[];
|
|
23
23
|
/**
|
|
24
24
|
* Get a filtered array of items that do not match the value
|
|
25
25
|
*
|
|
@@ -39,7 +39,7 @@ declare function exclude<Item, Callback extends (item: Item, index: number, arra
|
|
|
39
39
|
* ); // => [{id: 1}, {id: 3}]
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
|
-
declare function exclude<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): unknown[];
|
|
42
|
+
export declare function exclude<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): unknown[];
|
|
43
43
|
/**
|
|
44
44
|
* Get a filtered array of items that do not match the filter
|
|
45
45
|
*
|
|
@@ -57,7 +57,7 @@ declare function exclude<Item extends PlainObject, ItemKey extends keyof Item>(a
|
|
|
57
57
|
* ); // => [{id: 1}, {id: 3}]
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
|
-
declare function exclude<Item>(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): unknown[];
|
|
60
|
+
export declare function exclude<Item>(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): unknown[];
|
|
61
61
|
/**
|
|
62
62
|
* Get a filtered array of items that do not match the given item
|
|
63
63
|
*
|
|
@@ -72,7 +72,7 @@ declare function exclude<Item>(array: Item[], filter: (item: Item, index: number
|
|
|
72
72
|
* exclude([1, 2, 3], 2); // => [1, 3]
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
|
-
declare function exclude<Item>(array: Item[], item: Item): unknown[];
|
|
75
|
+
export declare function exclude<Item>(array: Item[], item: Item): unknown[];
|
|
76
76
|
/**
|
|
77
77
|
* Get a filtered array of items
|
|
78
78
|
*
|
|
@@ -90,7 +90,7 @@ declare function exclude<Item>(array: Item[], item: Item): unknown[];
|
|
|
90
90
|
* ); // => [{id: 2}]
|
|
91
91
|
* ```
|
|
92
92
|
*/
|
|
93
|
-
declare function filter<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], callback: Callback, value: ReturnType<Callback>): Item[];
|
|
93
|
+
export declare function filter<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], callback: Callback, value: ReturnType<Callback>): Item[];
|
|
94
94
|
/**
|
|
95
95
|
* Get a filtered array of items
|
|
96
96
|
*
|
|
@@ -108,7 +108,7 @@ declare function filter<Item, Callback extends (item: Item, index: number, array
|
|
|
108
108
|
* ); // => [{id: 2}]
|
|
109
109
|
* ```
|
|
110
110
|
*/
|
|
111
|
-
declare function filter<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): Item[];
|
|
111
|
+
export declare function filter<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): Item[];
|
|
112
112
|
/**
|
|
113
113
|
* Get a filtered array of items matching the filter
|
|
114
114
|
*
|
|
@@ -124,7 +124,7 @@ declare function filter<Item extends PlainObject, ItemKey extends keyof Item>(ar
|
|
|
124
124
|
* ); // => [{id: 2}]
|
|
125
125
|
* ```
|
|
126
126
|
*/
|
|
127
|
-
declare function filter<Item>(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): Item[];
|
|
127
|
+
export declare function filter<Item>(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): Item[];
|
|
128
128
|
/**
|
|
129
129
|
* Get a filtered array of items matching the given item
|
|
130
130
|
*
|
|
@@ -137,9 +137,8 @@ declare function filter<Item>(array: Item[], filter: (item: Item, index: number,
|
|
|
137
137
|
* filter([1, 2, 3], 2); // => [2]
|
|
138
138
|
* ```
|
|
139
139
|
*/
|
|
140
|
-
declare function filter<Item>(array: Item[], item: Item): Item[];
|
|
141
|
-
declare namespace filter {
|
|
140
|
+
export declare function filter<Item>(array: Item[], item: Item): Item[];
|
|
141
|
+
export declare namespace filter {
|
|
142
142
|
var remove: typeof exclude;
|
|
143
143
|
}
|
|
144
|
-
//#endregion
|
|
145
|
-
export { exclude, filter };
|
|
144
|
+
//#endregion
|
package/dist/array/filter.mjs
CHANGED
package/dist/array/find.d.mts
CHANGED
|
@@ -17,7 +17,7 @@ import { PlainObject } from "../models.mjs";
|
|
|
17
17
|
* ); // => {id: 1, value: 10}
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
declare function find<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], callback: Callback, value: ReturnType<Callback>): Item | undefined;
|
|
20
|
+
export declare function find<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], callback: Callback, value: ReturnType<Callback>): Item | undefined;
|
|
21
21
|
/**
|
|
22
22
|
* Get the first item matching the given value by key
|
|
23
23
|
*
|
|
@@ -35,7 +35,7 @@ declare function find<Item, Callback extends (item: Item, index: number, array:
|
|
|
35
35
|
* ); // => {id: 1, value: 10}
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
declare function find<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): Item | undefined;
|
|
38
|
+
export declare function find<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): Item | undefined;
|
|
39
39
|
/**
|
|
40
40
|
* Get the first item matching the filter
|
|
41
41
|
*
|
|
@@ -51,7 +51,7 @@ declare function find<Item extends PlainObject, ItemKey extends keyof Item>(arra
|
|
|
51
51
|
* ); // => {id: 1, value: 10}
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
|
-
declare function find<Item>(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): Item | undefined;
|
|
54
|
+
export declare function find<Item>(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): Item | undefined;
|
|
55
55
|
/**
|
|
56
56
|
* Get the first item matching the given value
|
|
57
57
|
*
|
|
@@ -64,8 +64,8 @@ declare function find<Item>(array: Item[], filter: (item: Item, index: number, a
|
|
|
64
64
|
* find([1, 2, 3, 2, 1], 1); // => 1
|
|
65
65
|
* ```
|
|
66
66
|
*/
|
|
67
|
-
declare function find<Item>(array: Item[], value: Item): Item | undefined;
|
|
68
|
-
declare namespace find {
|
|
67
|
+
export declare function find<Item>(array: Item[], value: Item): Item | undefined;
|
|
68
|
+
export declare namespace find {
|
|
69
69
|
var last: typeof findLast;
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
@@ -87,7 +87,7 @@ declare namespace find {
|
|
|
87
87
|
* ); // => {id: 3, value: 10}
|
|
88
88
|
* ```
|
|
89
89
|
*/
|
|
90
|
-
declare function findLast<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], callback: Callback, value: ReturnType<Callback>): Item | undefined;
|
|
90
|
+
export declare function findLast<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], callback: Callback, value: ReturnType<Callback>): Item | undefined;
|
|
91
91
|
/**
|
|
92
92
|
* Get the last item matching the given value by key
|
|
93
93
|
*
|
|
@@ -107,7 +107,7 @@ declare function findLast<Item, Callback extends (item: Item, index: number, arr
|
|
|
107
107
|
* ); // => {id: 3, value: 10}
|
|
108
108
|
* ```
|
|
109
109
|
*/
|
|
110
|
-
declare function findLast<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): Item | undefined;
|
|
110
|
+
export declare function findLast<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): Item | undefined;
|
|
111
111
|
/**
|
|
112
112
|
* Get the last item matching the filter
|
|
113
113
|
*
|
|
@@ -125,7 +125,7 @@ declare function findLast<Item extends PlainObject, ItemKey extends keyof Item>(
|
|
|
125
125
|
* ); // => {id: 3, value: 10}
|
|
126
126
|
* ```
|
|
127
127
|
*/
|
|
128
|
-
declare function findLast<Item>(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): Item | undefined;
|
|
128
|
+
export declare function findLast<Item>(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): Item | undefined;
|
|
129
129
|
/**
|
|
130
130
|
* Get the last item matching the given value
|
|
131
131
|
*
|
|
@@ -140,6 +140,5 @@ declare function findLast<Item>(array: Item[], filter: (item: Item, index: numbe
|
|
|
140
140
|
* findLast([1, 2, 3, 2, 1], 1); // => 1
|
|
141
141
|
* ```
|
|
142
142
|
*/
|
|
143
|
-
declare function findLast<Item>(array: Item[], value: Item): Item | undefined;
|
|
144
|
-
//#endregion
|
|
145
|
-
export { find, findLast };
|
|
143
|
+
export declare function findLast<Item>(array: Item[], value: Item): Item | undefined;
|
|
144
|
+
//#endregion
|
package/dist/array/find.mjs
CHANGED
package/dist/array/first.d.mts
CHANGED
|
@@ -17,7 +17,7 @@ import { PlainObject } from "../models.mjs";
|
|
|
17
17
|
* ); // => {id: 1, value: 10}
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
declare function first<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], callback: Callback, value: ReturnType<Callback>): Item | undefined;
|
|
20
|
+
export declare function first<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], callback: Callback, value: ReturnType<Callback>): Item | undefined;
|
|
21
21
|
/**
|
|
22
22
|
* Get the first item matching the given value by key
|
|
23
23
|
*
|
|
@@ -35,7 +35,7 @@ declare function first<Item, Callback extends (item: Item, index: number, array:
|
|
|
35
35
|
* ); // => {id: 1, value: 10}
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
declare function first<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): Item | undefined;
|
|
38
|
+
export declare function first<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): Item | undefined;
|
|
39
39
|
/**
|
|
40
40
|
* Get the first item matching the filter
|
|
41
41
|
*
|
|
@@ -51,7 +51,7 @@ declare function first<Item extends PlainObject, ItemKey extends keyof Item>(arr
|
|
|
51
51
|
* ); // => {id: 1, value: 10}
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
|
-
declare function first<Item>(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): Item | undefined;
|
|
54
|
+
export declare function first<Item>(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): Item | undefined;
|
|
55
55
|
/**
|
|
56
56
|
* Get the first item from an array
|
|
57
57
|
*
|
|
@@ -65,8 +65,8 @@ declare function first<Item>(array: Item[], filter: (item: Item, index: number,
|
|
|
65
65
|
* ); // => {id: 1, value: 10}
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
|
-
declare function first<Item>(array: Item[]): Item | undefined;
|
|
69
|
-
declare namespace first {
|
|
68
|
+
export declare function first<Item>(array: Item[]): Item | undefined;
|
|
69
|
+
export declare namespace first {
|
|
70
70
|
var _a: typeof firstOrDefault;
|
|
71
71
|
export { _a as default };
|
|
72
72
|
}
|
|
@@ -91,7 +91,7 @@ declare namespace first {
|
|
|
91
91
|
* ); // => {id: -1, value: 30}
|
|
92
92
|
* ```
|
|
93
93
|
*/
|
|
94
|
-
declare function firstOrDefault<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], defaultValue: Item, callback: Callback, value: ReturnType<Callback>): Item;
|
|
94
|
+
export declare function firstOrDefault<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], defaultValue: Item, callback: Callback, value: ReturnType<Callback>): Item;
|
|
95
95
|
/**
|
|
96
96
|
* Get the first item matching the given value by key, or a default value if no match is found
|
|
97
97
|
*
|
|
@@ -113,7 +113,7 @@ declare function firstOrDefault<Item, Callback extends (item: Item, index: numbe
|
|
|
113
113
|
* ); // => {id: -1, value: 30}
|
|
114
114
|
* ```
|
|
115
115
|
*/
|
|
116
|
-
declare function firstOrDefault<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], defaultValue: Item, key: ItemKey, value: Item[ItemKey]): Item;
|
|
116
|
+
export declare function firstOrDefault<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], defaultValue: Item, key: ItemKey, value: Item[ItemKey]): Item;
|
|
117
117
|
/**
|
|
118
118
|
* Get the first item matching the filter, or a default value if no match is found
|
|
119
119
|
*
|
|
@@ -133,7 +133,7 @@ declare function firstOrDefault<Item extends PlainObject, ItemKey extends keyof
|
|
|
133
133
|
* ); // => {id: -1, value: 30}
|
|
134
134
|
* ```
|
|
135
135
|
*/
|
|
136
|
-
declare function firstOrDefault<Item>(array: Item[], defaultValue: Item, filter: (item: Item, index: number, array: Item[]) => boolean): Item;
|
|
136
|
+
export declare function firstOrDefault<Item>(array: Item[], defaultValue: Item, filter: (item: Item, index: number, array: Item[]) => boolean): Item;
|
|
137
137
|
/**
|
|
138
138
|
* Get the first item from an array, or a default value if the array is empty
|
|
139
139
|
*
|
|
@@ -148,6 +148,5 @@ declare function firstOrDefault<Item>(array: Item[], defaultValue: Item, filter:
|
|
|
148
148
|
* firstOrDefault([], {id: -1, value: 30}); // => {id: -1, value: 30}
|
|
149
149
|
* ```
|
|
150
150
|
*/
|
|
151
|
-
declare function firstOrDefault<Item>(array: Item[], defaultValue: Item): Item;
|
|
152
|
-
//#endregion
|
|
153
|
-
export { first, firstOrDefault };
|
|
151
|
+
export declare function firstOrDefault<Item>(array: Item[], defaultValue: Item): Item;
|
|
152
|
+
//#endregion
|
package/dist/array/first.mjs
CHANGED
|
@@ -7,6 +7,5 @@ function firstOrDefault(array, defaultValue, ...parameters) {
|
|
|
7
7
|
return findAbsoluteValueOrDefault(array, parameters, defaultValue, true, false);
|
|
8
8
|
}
|
|
9
9
|
first.default = firstOrDefault;
|
|
10
|
-
Object.defineProperty(first, "default", { value: firstOrDefault });
|
|
11
10
|
//#endregion
|
|
12
11
|
export { first, firstOrDefault };
|
package/dist/array/flatten.d.mts
CHANGED
|
@@ -11,6 +11,5 @@ import { NestedArray } from "../models.mjs";
|
|
|
11
11
|
* flatten([1, [2, [3, 4], 5], 6]); // => [1, 2, 3, 4, 5, 6]
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
declare function flatten<Item>(array: Item[]): Array<NestedArray<Item>>;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { flatten };
|
|
14
|
+
export declare function flatten<Item>(array: Item[]): Array<NestedArray<Item>>;
|
|
15
|
+
//#endregion
|
package/dist/array/from.d.mts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* range(5); // => [0, 1, 2, 3, 4]
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
|
-
declare function range(length: number): number[];
|
|
13
|
+
export declare function range(length: number): number[];
|
|
14
14
|
/**
|
|
15
15
|
* Get an array of numbers in a specified range
|
|
16
16
|
*
|
|
@@ -23,7 +23,7 @@ declare function range(length: number): number[];
|
|
|
23
23
|
* range(2, 5); // => [2, 3, 4]
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
declare function range(start: number, end: number): number[];
|
|
26
|
+
export declare function range(start: number, end: number): number[];
|
|
27
27
|
/**
|
|
28
28
|
* Get an array of numbers in a specified range with a specified step
|
|
29
29
|
*
|
|
@@ -37,7 +37,7 @@ declare function range(start: number, end: number): number[];
|
|
|
37
37
|
* range(0, 10, 2); // => [0, 2, 4, 6, 8]
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
|
-
declare function range(start: number, end: number, step: number): number[];
|
|
40
|
+
export declare function range(start: number, end: number, step: number): number[];
|
|
41
41
|
/**
|
|
42
42
|
* Get an array with a specified length, filled with indices
|
|
43
43
|
*
|
|
@@ -49,7 +49,7 @@ declare function range(start: number, end: number, step: number): number[];
|
|
|
49
49
|
* times(5); // => [0, 1, 2, 3, 4]
|
|
50
50
|
* ```
|
|
51
51
|
*/
|
|
52
|
-
declare function times(length: number): number[];
|
|
52
|
+
export declare function times(length: number): number[];
|
|
53
53
|
/**
|
|
54
54
|
* Get an array with a specified length, filled by values from a callback
|
|
55
55
|
*
|
|
@@ -62,7 +62,7 @@ declare function times(length: number): number[];
|
|
|
62
62
|
* times(5, index => index * 2); // => [0, 2, 4, 6, 8]
|
|
63
63
|
* ```
|
|
64
64
|
*/
|
|
65
|
-
declare function times<Callback extends (index: number) => unknown>(length: number, callback: Callback): Array<ReturnType<Callback>>;
|
|
65
|
+
export declare function times<Callback extends (index: number) => unknown>(length: number, callback: Callback): Array<ReturnType<Callback>>;
|
|
66
66
|
/**
|
|
67
67
|
* Get an array with a specified length, filled with a specified value
|
|
68
68
|
*
|
|
@@ -75,6 +75,5 @@ declare function times<Callback extends (index: number) => unknown>(length: numb
|
|
|
75
75
|
* times(5, 'a'); // => ['a', 'a', 'a', 'a', 'a']
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
78
|
-
declare function times<Value>(length: number, value: Value): Value[];
|
|
79
|
-
//#endregion
|
|
80
|
-
export { range, times };
|
|
78
|
+
export declare function times<Value>(length: number, value: Value): Value[];
|
|
79
|
+
//#endregion
|
|
@@ -19,7 +19,7 @@ import { Key, KeyOrCallback, KeyOrCallbackKey, KeyOrCallbackValue, Simplify } fr
|
|
|
19
19
|
* ); // => {10: {id: 3, value: 10}, 20: {id: 2, value: 20}}
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
declare function groupBy<Item, KeyArg extends KeyOrCallback<Item, Key>, ValueArg extends KeyOrCallback<Item>>(array: Item[], key: KeyArg, value: ValueArg): Simplify<Record<KeyOrCallbackKey<Item, KeyArg>, KeyOrCallbackValue<Item, ValueArg>>>;
|
|
22
|
+
export declare function groupBy<Item, KeyArg extends KeyOrCallback<Item, Key>, ValueArg extends KeyOrCallback<Item>>(array: Item[], key: KeyArg, value: ValueArg): Simplify<Record<KeyOrCallbackKey<Item, KeyArg>, KeyOrCallbackValue<Item, ValueArg>>>;
|
|
23
23
|
/**
|
|
24
24
|
* Create a record from an array of items using a specific key
|
|
25
25
|
*
|
|
@@ -37,7 +37,7 @@ declare function groupBy<Item, KeyArg extends KeyOrCallback<Item, Key>, ValueArg
|
|
|
37
37
|
* ); // => {10: {id: 3, value: 10}, 20: {id: 2, value: 20}}
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
|
-
declare function groupBy<Item, KeyArg extends KeyOrCallback<Item, Key>>(array: Item[], key: KeyArg): Simplify<Record<KeyOrCallbackKey<Item, KeyArg>, Item>>;
|
|
40
|
+
export declare function groupBy<Item, KeyArg extends KeyOrCallback<Item, Key>>(array: Item[], key: KeyArg): Simplify<Record<KeyOrCallbackKey<Item, KeyArg>, Item>>;
|
|
41
41
|
/**
|
|
42
42
|
* Create a record from an array of items _(using indices as keys)_
|
|
43
43
|
*
|
|
@@ -51,8 +51,8 @@ declare function groupBy<Item, KeyArg extends KeyOrCallback<Item, Key>>(array: I
|
|
|
51
51
|
* ); // => {0: {id: 1, value: 10}, 1: {id: 2, value: 20}, 2: {id: 3, value: 10}}
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
|
-
declare function groupBy<Item>(array: Item[]): Record<number, Item>;
|
|
55
|
-
declare namespace groupBy {
|
|
54
|
+
export declare function groupBy<Item>(array: Item[]): Record<number, Item>;
|
|
55
|
+
export declare namespace groupBy {
|
|
56
56
|
var arrays: typeof groupArraysBy;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
@@ -77,7 +77,7 @@ declare namespace groupBy {
|
|
|
77
77
|
* // }
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
|
-
declare function groupArraysBy<Item, KeyArg extends KeyOrCallback<Item, Key>, ValueArg extends KeyOrCallback<Item>>(array: Item[], key: KeyArg, value: ValueArg): Simplify<Record<KeyOrCallbackKey<Item, KeyArg>, Array<KeyOrCallbackValue<Item, ValueArg>>>>;
|
|
80
|
+
export declare function groupArraysBy<Item, KeyArg extends KeyOrCallback<Item, Key>, ValueArg extends KeyOrCallback<Item>>(array: Item[], key: KeyArg, value: ValueArg): Simplify<Record<KeyOrCallbackKey<Item, KeyArg>, Array<KeyOrCallbackValue<Item, ValueArg>>>>;
|
|
81
81
|
/**
|
|
82
82
|
* Create a record from an array of items using a specific key, grouping items into arrays
|
|
83
83
|
*
|
|
@@ -98,6 +98,5 @@ declare function groupArraysBy<Item, KeyArg extends KeyOrCallback<Item, Key>, Va
|
|
|
98
98
|
* // }
|
|
99
99
|
* ```
|
|
100
100
|
*/
|
|
101
|
-
declare function groupArraysBy<Item, KeyArg extends KeyOrCallback<Item, Key>>(array: Item[], key: KeyArg): Simplify<Record<KeyOrCallbackKey<Item, KeyArg>, Item[]>>;
|
|
102
|
-
//#endregion
|
|
103
|
-
export { groupArraysBy, groupBy };
|
|
101
|
+
export declare function groupArraysBy<Item, KeyArg extends KeyOrCallback<Item, Key>>(array: Item[], key: KeyArg): Simplify<Record<KeyOrCallbackKey<Item, KeyArg>, Item[]>>;
|
|
102
|
+
//#endregion
|
package/dist/array/group-by.mjs
CHANGED
package/dist/array/insert.d.mts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* insert([1, 2, 3], 1, [4, 5]); // => [1, 4, 5, 2, 3]
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
declare function insert<Item>(array: Item[], index: number, items: Item[]): Item[];
|
|
17
|
+
export declare function insert<Item>(array: Item[], index: number, items: Item[]): Item[];
|
|
18
18
|
/**
|
|
19
19
|
* Insert items into an array _(at the end)_
|
|
20
20
|
*
|
|
@@ -29,6 +29,5 @@ declare function insert<Item>(array: Item[], index: number, items: Item[]): Item
|
|
|
29
29
|
* insert([1, 2, 3], [4, 5]); // => [1, 2, 3, 4, 5]
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
-
declare function insert<Item>(array: Item[], items: Item[]): Item[];
|
|
33
|
-
//#endregion
|
|
34
|
-
export { insert };
|
|
32
|
+
export declare function insert<Item>(array: Item[], items: Item[]): Item[];
|
|
33
|
+
//#endregion
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* ); // => [{id: 2}, {id: 3}]
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
-
declare function intersection<First, Second>(first: First[], second: Second[], callback: (item: First | Second) => unknown): First[];
|
|
19
|
+
export declare function intersection<First, Second>(first: First[], second: Second[], callback: (item: First | Second) => unknown): First[];
|
|
20
20
|
/**
|
|
21
21
|
* Get the common values between two arrays
|
|
22
22
|
*
|
|
@@ -34,7 +34,7 @@ declare function intersection<First, Second>(first: First[], second: Second[], c
|
|
|
34
34
|
* ); // => [{id: 2}, {id: 3}]
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
|
-
declare function intersection<First extends Record<string, unknown>, Second extends Record<string, unknown>, SharedKey extends keyof First & keyof Second>(first: First[], second: Second[], key: SharedKey): First[];
|
|
37
|
+
export declare function intersection<First extends Record<string, unknown>, Second extends Record<string, unknown>, SharedKey extends keyof First & keyof Second>(first: First[], second: Second[], key: SharedKey): First[];
|
|
38
38
|
/**
|
|
39
39
|
* Get the common values between two arrays
|
|
40
40
|
*
|
|
@@ -50,6 +50,5 @@ declare function intersection<First extends Record<string, unknown>, Second exte
|
|
|
50
50
|
* ); // => [2, 3]
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
53
|
-
declare function intersection<First, Second>(first: First[], second: Second[]): First[];
|
|
54
|
-
//#endregion
|
|
55
|
-
export { intersection };
|
|
53
|
+
export declare function intersection<First, Second>(first: First[], second: Second[]): First[];
|
|
54
|
+
//#endregion
|
package/dist/array/last.d.mts
CHANGED
|
@@ -17,7 +17,7 @@ import { PlainObject } from "../models.mjs";
|
|
|
17
17
|
* ); // => {id: 3, value: 10}
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
declare function last<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], callback: Callback, value: ReturnType<Callback>): Item | undefined;
|
|
20
|
+
export declare function last<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], callback: Callback, value: ReturnType<Callback>): Item | undefined;
|
|
21
21
|
/**
|
|
22
22
|
* Get the first item matching the given value by key
|
|
23
23
|
*
|
|
@@ -35,7 +35,7 @@ declare function last<Item, Callback extends (item: Item, index: number, array:
|
|
|
35
35
|
* ); // => {id: 3, value: 10}
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
declare function last<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): Item | undefined;
|
|
38
|
+
export declare function last<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], key: ItemKey, value: Item[ItemKey]): Item | undefined;
|
|
39
39
|
/**
|
|
40
40
|
* Get the last item matching the filter
|
|
41
41
|
*
|
|
@@ -51,7 +51,7 @@ declare function last<Item extends PlainObject, ItemKey extends keyof Item>(arra
|
|
|
51
51
|
* ); // => {id: 3, value: 10}
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
|
-
declare function last<Item>(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): Item | undefined;
|
|
54
|
+
export declare function last<Item>(array: Item[], filter: (item: Item, index: number, array: Item[]) => boolean): Item | undefined;
|
|
55
55
|
/**
|
|
56
56
|
* Get the last item from an array
|
|
57
57
|
*
|
|
@@ -63,8 +63,8 @@ declare function last<Item>(array: Item[], filter: (item: Item, index: number, a
|
|
|
63
63
|
* last([1, 2, 3]); // => 3
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
|
-
declare function last<Item>(array: Item[]): Item | undefined;
|
|
67
|
-
declare namespace last {
|
|
66
|
+
export declare function last<Item>(array: Item[]): Item | undefined;
|
|
67
|
+
export declare namespace last {
|
|
68
68
|
var _a: typeof lastOrDefault;
|
|
69
69
|
export { _a as default };
|
|
70
70
|
}
|
|
@@ -89,7 +89,7 @@ declare namespace last {
|
|
|
89
89
|
* ); // => {id: -1, value: 30}
|
|
90
90
|
* ```
|
|
91
91
|
*/
|
|
92
|
-
declare function lastOrDefault<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], defaultValue: Item, callback: Callback, value: ReturnType<Callback>): Item;
|
|
92
|
+
export declare function lastOrDefault<Item, Callback extends (item: Item, index: number, array: Item[]) => unknown>(array: Item[], defaultValue: Item, callback: Callback, value: ReturnType<Callback>): Item;
|
|
93
93
|
/**
|
|
94
94
|
* Get the last item matching the given value by key
|
|
95
95
|
*
|
|
@@ -111,7 +111,7 @@ declare function lastOrDefault<Item, Callback extends (item: Item, index: number
|
|
|
111
111
|
* ); // => {id: -1, value: 30}
|
|
112
112
|
* ```
|
|
113
113
|
*/
|
|
114
|
-
declare function lastOrDefault<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], defaultValue: Item, key: ItemKey, value: Item[ItemKey]): Item;
|
|
114
|
+
export declare function lastOrDefault<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], defaultValue: Item, key: ItemKey, value: Item[ItemKey]): Item;
|
|
115
115
|
/**
|
|
116
116
|
* Get the last item matching the filter
|
|
117
117
|
*
|
|
@@ -131,7 +131,7 @@ declare function lastOrDefault<Item extends PlainObject, ItemKey extends keyof I
|
|
|
131
131
|
* ); // => {id: -1, value: 30}
|
|
132
132
|
* ```
|
|
133
133
|
*/
|
|
134
|
-
declare function lastOrDefault<Item>(array: Item[], defaultValue: Item, filter: (item: Item, index: number, array: Item[]) => boolean): Item;
|
|
134
|
+
export declare function lastOrDefault<Item>(array: Item[], defaultValue: Item, filter: (item: Item, index: number, array: Item[]) => boolean): Item;
|
|
135
135
|
/**
|
|
136
136
|
* Get the last item from an array
|
|
137
137
|
*
|
|
@@ -146,6 +146,5 @@ declare function lastOrDefault<Item>(array: Item[], defaultValue: Item, filter:
|
|
|
146
146
|
* lastOrDefault([], {id: -1, value: 30}); // => {id: -1, value: 30}
|
|
147
147
|
* ```
|
|
148
148
|
*/
|
|
149
|
-
declare function lastOrDefault<Item>(array: Item[], defaultValue: Item): Item;
|
|
150
|
-
//#endregion
|
|
151
|
-
export { last, lastOrDefault };
|
|
149
|
+
export declare function lastOrDefault<Item>(array: Item[], defaultValue: Item): Item;
|
|
150
|
+
//#endregion
|
package/dist/array/last.mjs
CHANGED
|
@@ -7,6 +7,5 @@ function lastOrDefault(array, defaultValue, ...parameters) {
|
|
|
7
7
|
return findAbsoluteValueOrDefault(array, parameters, defaultValue, true, true);
|
|
8
8
|
}
|
|
9
9
|
last.default = lastOrDefault;
|
|
10
|
-
Object.defineProperty(last, "default", { value: lastOrDefault });
|
|
11
10
|
//#endregion
|
|
12
11
|
export { last, lastOrDefault };
|
package/dist/array/move.d.mts
CHANGED
|
@@ -22,7 +22,7 @@ import { PlainObject } from "../models.mjs";
|
|
|
22
22
|
* move(array, {id: 5}, {id: 1}, item => item.id); // => [{id: 1}, {id: 2}, {id: 3}, {id: 4}] (unchanged)
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
|
-
declare function move<Item>(array: Item[], from: Item | Item[], to: Item | Item[], callback: (item: Item, index: number, array: Item[]) => unknown): Item[];
|
|
25
|
+
export declare function move<Item>(array: Item[], from: Item | Item[], to: Item | Item[], callback: (item: Item, index: number, array: Item[]) => unknown): Item[];
|
|
26
26
|
/**
|
|
27
27
|
* Move an item _(or array of items)_ to the position of another item _(or array of items)_ within an array
|
|
28
28
|
*
|
|
@@ -45,7 +45,7 @@ declare function move<Item>(array: Item[], from: Item | Item[], to: Item | Item[
|
|
|
45
45
|
* move(array, {id: 5}, {id: 1}, 'id'); // => [{id: 1}, {id: 2}, {id: 3}, {id: 4}] (unchanged)
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
|
-
declare function move<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], from: Item | Item[], to: Item | Item[], key: ItemKey): Item[];
|
|
48
|
+
export declare function move<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], from: Item | Item[], to: Item | Item[], key: ItemKey): Item[];
|
|
49
49
|
/**
|
|
50
50
|
* Move an item _(or array of items)_ to the position of another item _(or array of items)_ within an array
|
|
51
51
|
*
|
|
@@ -67,8 +67,8 @@ declare function move<Item extends PlainObject, ItemKey extends keyof Item>(arra
|
|
|
67
67
|
* move(array, 5, 1); // => [1, 2, 3, 4] (unchanged)
|
|
68
68
|
* ```
|
|
69
69
|
*/
|
|
70
|
-
declare function move<Item>(array: Item[], from: Item | Item[], to: Item | Item[]): Item[];
|
|
71
|
-
declare namespace move {
|
|
70
|
+
export declare function move<Item>(array: Item[], from: Item | Item[], to: Item | Item[]): Item[];
|
|
71
|
+
export declare namespace move {
|
|
72
72
|
var indices: typeof moveIndices;
|
|
73
73
|
var toIndex: typeof moveToIndex;
|
|
74
74
|
}
|
|
@@ -93,7 +93,7 @@ declare namespace move {
|
|
|
93
93
|
* moveIndices(array, 5, 1); // => [4, 2, 3, 1] (unchanged)
|
|
94
94
|
* ```
|
|
95
95
|
*/
|
|
96
|
-
declare function moveIndices<Item>(array: Item[], from: number, to: number): Item[];
|
|
96
|
+
export declare function moveIndices<Item>(array: Item[], from: number, to: number): Item[];
|
|
97
97
|
/**
|
|
98
98
|
* Move an item _(or array of items)_ to an index within an array
|
|
99
99
|
*
|
|
@@ -116,7 +116,7 @@ declare function moveIndices<Item>(array: Item[], from: number, to: number): Ite
|
|
|
116
116
|
* @param callback Callback to get an item's value for matching
|
|
117
117
|
* @returns Original array with items moved _(or unchanged if unable to move)_
|
|
118
118
|
*/
|
|
119
|
-
declare function moveToIndex<Item>(array: Item[], value: Item | Item[], index: number, callback: (item: Item, index: number, array: Item[]) => unknown): Item[];
|
|
119
|
+
export declare function moveToIndex<Item>(array: Item[], value: Item | Item[], index: number, callback: (item: Item, index: number, array: Item[]) => unknown): Item[];
|
|
120
120
|
/**
|
|
121
121
|
* Move an item _(or array of items)_ to an index within an array
|
|
122
122
|
*
|
|
@@ -139,7 +139,7 @@ declare function moveToIndex<Item>(array: Item[], value: Item | Item[], index: n
|
|
|
139
139
|
* moveToIndex(array, {id: 5}, 1, 'id'); // => [{id: 1}, {id: 2}, {id: 3}, {id: 4}] (unchanged)
|
|
140
140
|
* ```
|
|
141
141
|
*/
|
|
142
|
-
declare function moveToIndex<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], value: Item | Item[], index: number, key: ItemKey): Item[];
|
|
142
|
+
export declare function moveToIndex<Item extends PlainObject, ItemKey extends keyof Item>(array: Item[], value: Item | Item[], index: number, key: ItemKey): Item[];
|
|
143
143
|
/**
|
|
144
144
|
* Move an item _(or array of items)_ to an index within an array
|
|
145
145
|
*
|
|
@@ -161,6 +161,5 @@ declare function moveToIndex<Item extends PlainObject, ItemKey extends keyof Ite
|
|
|
161
161
|
* moveToIndex(array, 5, 1); // => [1, 2, 3, 4] (unchanged)
|
|
162
162
|
* ```
|
|
163
163
|
*/
|
|
164
|
-
declare function moveToIndex<Item>(array: Item[], value: Item | Item[], index: number): Item[];
|
|
165
|
-
//#endregion
|
|
166
|
-
export { move, moveIndices, moveToIndex };
|
|
164
|
+
export declare function moveToIndex<Item>(array: Item[], value: Item | Item[], index: number): Item[];
|
|
165
|
+
//#endregion
|
package/dist/array/move.mjs
CHANGED
|
@@ -72,9 +72,5 @@ function moveToIndex(array, value, index, key) {
|
|
|
72
72
|
}
|
|
73
73
|
move.indices = moveIndices;
|
|
74
74
|
move.toIndex = moveToIndex;
|
|
75
|
-
Object.defineProperties(move, {
|
|
76
|
-
indices: { value: moveIndices },
|
|
77
|
-
toIndex: { value: moveToIndex }
|
|
78
|
-
});
|
|
79
75
|
//#endregion
|
|
80
76
|
export { move, moveIndices, moveToIndex };
|