@tolki/path 1.0.0 → 1.0.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/index.js +3 -36
- package/dist/path.d.ts +3 -0
- package/dist/path.d.ts.map +1 -1
- package/dist/path.js +493 -656
- package/dist/pluck.d.ts.map +1 -1
- package/dist/pluck.js +55 -62
- package/package.json +7 -5
package/dist/index.js
CHANGED
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
4
|
-
a as MAX_UNDOT_INDEX,
|
|
5
|
-
s as dotFlatten,
|
|
6
|
-
d as dotFlattenArray,
|
|
7
|
-
l as dotFlattenObject,
|
|
8
|
-
V as explodePluckPath,
|
|
9
|
-
r as forgetKeys,
|
|
10
|
-
u as forgetKeysArray,
|
|
11
|
-
o as forgetKeysObject,
|
|
12
|
-
c as getMixedValue,
|
|
13
|
-
n as getNestedValue,
|
|
14
|
-
h as getObjectValue,
|
|
15
|
-
I as getPluckWildcardValues,
|
|
16
|
-
x as getRaw,
|
|
17
|
-
i as hasMixed,
|
|
18
|
-
P as hasObjectKey,
|
|
19
|
-
b as hasPath,
|
|
20
|
-
F as hasPluckPath,
|
|
21
|
-
N as isArrayAccess,
|
|
22
|
-
g as isCanonicalUndotIndex,
|
|
23
|
-
D as isEnumerable,
|
|
24
|
-
p as parseSegments,
|
|
25
|
-
y as pushMixed,
|
|
26
|
-
m as pushWithPath,
|
|
27
|
-
U as readPluckKey,
|
|
28
|
-
W as resolvePluckPath,
|
|
29
|
-
O as setImmutable,
|
|
30
|
-
j as setMixed,
|
|
31
|
-
A as setMixedImmutable,
|
|
32
|
-
M as setObjectValue,
|
|
33
|
-
f as undotExpand,
|
|
34
|
-
k as undotExpandArray,
|
|
35
|
-
E as undotExpandObject
|
|
36
|
-
};
|
|
1
|
+
import { explodePluckPath as e, getPluckWildcardValues as t, hasPluckPath as n, isArrayAccess as r, isEnumerable as i, readPluckKey as a, resolvePluckPath as o } from "./pluck.js";
|
|
2
|
+
import { MAX_UNDOT_INDEX as s, dotFlatten as c, dotFlattenArray as l, dotFlattenObject as u, forgetKeys as d, forgetKeysArray as f, forgetKeysObject as p, getMixedValue as m, getNestedValue as h, getObjectValue as g, getRaw as _, hasMixed as v, hasObjectKey as y, hasPath as b, isCanonicalUndotIndex as x, parseSegments as S, pushMixed as C, pushWithPath as w, setImmutable as T, setMixed as E, setMixedImmutable as D, setObjectValue as O, undotExpand as k, undotExpandArray as A, undotExpandObject as j } from "./path.js";
|
|
3
|
+
export { s as MAX_UNDOT_INDEX, c as dotFlatten, l as dotFlattenArray, u as dotFlattenObject, e as explodePluckPath, d as forgetKeys, f as forgetKeysArray, p as forgetKeysObject, m as getMixedValue, h as getNestedValue, g as getObjectValue, t as getPluckWildcardValues, _ as getRaw, v as hasMixed, y as hasObjectKey, b as hasPath, n as hasPluckPath, r as isArrayAccess, x as isCanonicalUndotIndex, i as isEnumerable, S as parseSegments, C as pushMixed, w as pushWithPath, a as readPluckKey, o as resolvePluckPath, T as setImmutable, E as setMixed, D as setMixedImmutable, O as setObjectValue, k as undotExpand, A as undotExpandArray, j as undotExpandObject };
|
package/dist/path.d.ts
CHANGED
|
@@ -157,6 +157,7 @@ export declare function setImmutable<TValue>(data: ArrayItems<TValue> | unknown,
|
|
|
157
157
|
* Push an item into an array using "dot" notation, walking lists, plain objects and Maps and replacing anything else
|
|
158
158
|
* along the path, as Arr::set does.
|
|
159
159
|
*
|
|
160
|
+
* @sideEffects mutates - Pushes onto the given array and writes missing containers into it.
|
|
160
161
|
* @param data - The array to push values into.
|
|
161
162
|
* @param key - The path where to push values (number, string, null, or undefined).
|
|
162
163
|
* @param values - The values to push.
|
|
@@ -348,6 +349,7 @@ export declare function getMixedValue<TValue, TDefault = null>(data: ArrayItems<
|
|
|
348
349
|
* Set a value in an array using mixed array/object dot notation (mutable version).
|
|
349
350
|
* Supports both numeric array indices and object property names in paths.
|
|
350
351
|
*
|
|
352
|
+
* @sideEffects mutates - Writes into the given array and the containers along the path.
|
|
351
353
|
* @param The root array to modify.
|
|
352
354
|
* @param key - The path where to set the value.
|
|
353
355
|
* @param value - The value to set.
|
|
@@ -363,6 +365,7 @@ export declare function setMixed<TValue>(arr: TValue[], key: PathKey, value: unk
|
|
|
363
365
|
* Push values to an array at the specified mixed path.
|
|
364
366
|
* Supports both numeric array indices and object property names in paths.
|
|
365
367
|
*
|
|
368
|
+
* @sideEffects mutates - Pushes onto the given array and the containers along the path.
|
|
366
369
|
* @param data - The data to push values into.
|
|
367
370
|
* @param key - The path where to push (supports mixed array/object paths).
|
|
368
371
|
* @param values - The values to push.
|
package/dist/path.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../src/path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,UAAU,EACV,OAAO,EACP,aAAa,EACb,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACb,MAAM,cAAc,CAAC;AAgCtB;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../src/path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,UAAU,EACV,OAAO,EACP,aAAa,EACb,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACb,MAAM,cAAc,CAAC;AAgCtB;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,IAAI,CAgCtE;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,wBAAgB,OAAO,CAAC,MAAM,EAAE,IAAI,SAAS,WAAW,GAAG,WAAW,EAClE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,EACrC,GAAG,EAAE,OAAO,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