@rimbu/deep 2.0.1 → 2.0.3
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/README.md +295 -60
- package/dist/bun/deep.mts +8 -8
- package/dist/bun/match.mts +29 -27
- package/dist/bun/patch.mts +11 -10
- package/dist/bun/path.mts +98 -100
- package/dist/bun/protected.mts +18 -17
- package/dist/bun/selector.mts +22 -20
- package/dist/bun/tuple.mts +6 -2
- package/dist/cjs/deep.cjs +18 -18
- package/dist/cjs/deep.cjs.map +1 -1
- package/dist/cjs/deep.d.cts +6 -6
- package/dist/cjs/match.cjs +2 -3
- package/dist/cjs/match.cjs.map +1 -1
- package/dist/cjs/match.d.cts +2 -2
- package/dist/cjs/patch.cjs +2 -3
- package/dist/cjs/patch.cjs.map +1 -1
- package/dist/cjs/patch.d.cts +1 -1
- package/dist/cjs/path.cjs +5 -5
- package/dist/cjs/path.cjs.map +1 -1
- package/dist/cjs/path.d.cts +8 -6
- package/dist/cjs/selector.cjs +1 -2
- package/dist/cjs/selector.cjs.map +1 -1
- package/dist/cjs/tuple.cjs +1 -1
- package/dist/cjs/tuple.cjs.map +1 -1
- package/dist/cjs/tuple.d.cts +5 -1
- package/dist/esm/deep.d.mts +6 -6
- package/dist/esm/deep.mjs +6 -6
- package/dist/esm/match.d.mts +2 -2
- package/dist/esm/match.mjs +1 -1
- package/dist/esm/match.mjs.map +1 -1
- package/dist/esm/patch.d.mts +1 -1
- package/dist/esm/patch.mjs +1 -1
- package/dist/esm/patch.mjs.map +1 -1
- package/dist/esm/path.d.mts +8 -6
- package/dist/esm/path.mjs +2 -2
- package/dist/esm/path.mjs.map +1 -1
- package/dist/esm/selector.mjs.map +1 -1
- package/dist/esm/tuple.d.mts +5 -1
- package/dist/esm/tuple.mjs +1 -1
- package/dist/esm/tuple.mjs.map +1 -1
- package/package.json +7 -7
- package/src/deep.mts +8 -8
- package/src/match.mts +29 -27
- package/src/patch.mts +11 -10
- package/src/path.mts +98 -100
- package/src/protected.mts +18 -17
- package/src/selector.mts +22 -20
- package/src/tuple.mts +6 -2
package/src/tuple.mts
CHANGED
|
@@ -17,6 +17,10 @@ export namespace Tuple {
|
|
|
17
17
|
*/
|
|
18
18
|
export type Source = readonly unknown[];
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Determines whether the given type `T` is a tuple type.
|
|
22
|
+
* @typeparam T - the input type
|
|
23
|
+
*/
|
|
20
24
|
export type IsTuple<T> = T extends { length: infer L }
|
|
21
25
|
? 0 extends L
|
|
22
26
|
? false
|
|
@@ -43,7 +47,7 @@ export namespace Tuple {
|
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
/**
|
|
46
|
-
* Returns the item at the given `index` in the
|
|
50
|
+
* Returns the item at the given `index` in the given `tuple`.
|
|
47
51
|
* @param tuple - the tuple to get the item from
|
|
48
52
|
* @param index - the index in of the tuple element
|
|
49
53
|
* @example
|
|
@@ -138,7 +142,7 @@ export namespace Tuple {
|
|
|
138
142
|
*/
|
|
139
143
|
export function append<
|
|
140
144
|
T extends Tuple.Source,
|
|
141
|
-
V extends readonly [unknown, ...unknown[]]
|
|
145
|
+
V extends readonly [unknown, ...unknown[]],
|
|
142
146
|
>(tuple: T, ...values: V): readonly [...T, ...V] {
|
|
143
147
|
return [...tuple, ...values];
|
|
144
148
|
}
|