@tobio0310/json-walker 0.0.0-stage → 1.0.1
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/LICENSE +18 -0
- package/README.md +2 -2
- package/dist/helpers.d.ts +3 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +4 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +79 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes.d.ts +48 -0
- package/dist/nodes.d.ts.map +1 -0
- package/dist/nodes.js +2 -0
- package/dist/nodes.js.map +1 -0
- package/package.json +46 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 tobio0310
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
6
|
+
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
|
7
|
+
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
|
9
|
+
following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
12
|
+
portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
15
|
+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
16
|
+
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
17
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
18
|
+
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# jsonWalker
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A small TypeScript library for walking across a javascript object using string notation
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC;AAEvD,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,OAAO,EAAE,CAE3E"}
|
package/dist/helpers.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,eAAe,CAAC,KAAc;IAC1C,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ExpandKey, ResolvePath, ValidNode } from "./nodes.js";
|
|
2
|
+
export type { ExpandKey, ResolvePath, ValidNode };
|
|
3
|
+
/**
|
|
4
|
+
* Tries to walk a JS object using the given `key`.
|
|
5
|
+
*
|
|
6
|
+
* Using this function, you can use keys like `users.*.address.city` to get an array of strings,
|
|
7
|
+
* which will be each user's city.
|
|
8
|
+
*
|
|
9
|
+
* Using TypeScript, you will be prompted all valid keys. :)
|
|
10
|
+
*
|
|
11
|
+
* @param key the traversal key
|
|
12
|
+
* @param node the object to traverse
|
|
13
|
+
* @param isLeaf a function that returns `true` if the given value is a leaf.
|
|
14
|
+
* @returns the value the key represents.
|
|
15
|
+
*/
|
|
16
|
+
export declare function tryWalk<Leaf, Key extends ExpandKey<Leaf, Node>, Node extends ValidNode<Leaf>>(key: Key, node: Node, isLeaf: (value: unknown) => value is Leaf): ResolvePath<Leaf, Node, Key> | null;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIpE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;AAElD;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CACnB,IAAI,EACJ,GAAG,SAAS,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,EACjC,IAAI,SAAS,SAAS,CAAC,IAAI,CAAC,EAE5B,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,IAAI,GAC1C,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,IAAI,CAuErC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { isReadonlyArray } from "./helpers.js";
|
|
2
|
+
/**
|
|
3
|
+
* Tries to walk a JS object using the given `key`.
|
|
4
|
+
*
|
|
5
|
+
* Using this function, you can use keys like `users.*.address.city` to get an array of strings,
|
|
6
|
+
* which will be each user's city.
|
|
7
|
+
*
|
|
8
|
+
* Using TypeScript, you will be prompted all valid keys. :)
|
|
9
|
+
*
|
|
10
|
+
* @param key the traversal key
|
|
11
|
+
* @param node the object to traverse
|
|
12
|
+
* @param isLeaf a function that returns `true` if the given value is a leaf.
|
|
13
|
+
* @returns the value the key represents.
|
|
14
|
+
*/
|
|
15
|
+
export function tryWalk(key, node, isLeaf) {
|
|
16
|
+
const segments = key.split(".");
|
|
17
|
+
let current = node;
|
|
18
|
+
for (let i = 0; i < segments.length; i++) {
|
|
19
|
+
if (current === undefined || current === null) {
|
|
20
|
+
// pointer to unknown
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const segment = segments[i];
|
|
24
|
+
if (segment === undefined) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
if (isReadonlyArray(current)) {
|
|
28
|
+
if (segment === "*") {
|
|
29
|
+
const remainingPath = segments.slice(i + 1).join(".");
|
|
30
|
+
// if ends on *, return array
|
|
31
|
+
if (!remainingPath) {
|
|
32
|
+
if (!current.every(isLeaf))
|
|
33
|
+
return null; // must be valid leaves
|
|
34
|
+
return current;
|
|
35
|
+
}
|
|
36
|
+
// else map over items
|
|
37
|
+
const results = [];
|
|
38
|
+
for (const item of current) {
|
|
39
|
+
const resolved = tryWalk(remainingPath, item, isLeaf);
|
|
40
|
+
if (resolved === null) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
results.push(resolved);
|
|
44
|
+
}
|
|
45
|
+
return results;
|
|
46
|
+
}
|
|
47
|
+
const index = Number(segment);
|
|
48
|
+
if (Number.isNaN(index)) {
|
|
49
|
+
// should've been a number..??
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
current = current[index];
|
|
53
|
+
}
|
|
54
|
+
else if (isLeaf(current)) {
|
|
55
|
+
// got to string or ReactElement
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
else if (typeof current === "object") {
|
|
59
|
+
if (segment === "*") {
|
|
60
|
+
if (i !== segments.length - 1) {
|
|
61
|
+
return null; // only terminal `.*` is supported on objects
|
|
62
|
+
}
|
|
63
|
+
return { ...current };
|
|
64
|
+
}
|
|
65
|
+
current = current[segment];
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
// for some reason nothing correct??
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (isLeaf(current) ||
|
|
73
|
+
(isReadonlyArray(current) && current.every(isLeaf))) {
|
|
74
|
+
return current;
|
|
75
|
+
}
|
|
76
|
+
// incomplete traversal
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAO/C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,OAAO,CAKnB,GAAQ,EACR,IAAU,EACV,MAAyC;IAEzC,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,IAAI,OAAO,GAAqB,IAAI,CAAC;IAErC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YAC5C,qBAAqB;YACrB,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,IAAI,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;YAC3B,IAAI,OAAO,KAAK,GAAG,EAAE,CAAC;gBAClB,MAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACtD,6BAA6B;gBAC7B,IAAI,CAAC,aAAa,EAAE,CAAC;oBACjB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;wBAAE,OAAO,IAAI,CAAC,CAAC,uBAAuB;oBAChE,OAAO,OAAuC,CAAC;gBACnD,CAAC;gBACD,sBAAsB;gBACtB,MAAM,OA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IAED,uBAAuB;IACvB,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
package/dist/nodes.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type WrapArray } from "./helpers.js";
|
|
2
|
+
/**
|
|
3
|
+
* For a object to be valid, it must satisfy this type.
|
|
4
|
+
*
|
|
5
|
+
* @example ```js
|
|
6
|
+
* const en = { pages: {
|
|
7
|
+
* home: { title: "Title" },
|
|
8
|
+
* todo: { items: [
|
|
9
|
+
* { name: "Make breakfast", done: "no" }
|
|
10
|
+
* ]},
|
|
11
|
+
* }}
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @param Leaf a union of the the valid leaf types
|
|
15
|
+
*/
|
|
16
|
+
export interface ValidNode<Leaf> {
|
|
17
|
+
[key: string | number]: Leaf | readonly Leaf[] | ValidNode<Leaf> | readonly ValidNode<Leaf>[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* This function will expand any {@link ValidNode} objects into a string union of valid i18n keys to be used.
|
|
21
|
+
*
|
|
22
|
+
* @param Leaf a union of the the valid leaf types
|
|
23
|
+
* @param Node the object to expand
|
|
24
|
+
* @see a union of the valid leaf types
|
|
25
|
+
*/
|
|
26
|
+
export type ExpandKey<Leaf, Node extends ValidNode<Leaf>> = {
|
|
27
|
+
[Key in keyof Node & string]: Node[Key] extends Leaf ? `${Key}` : Node[Key] extends readonly Leaf[] ? `${Key}` | `${Key}.*` | `${Key}.${number}` : Node[Key] extends readonly ValidNode<Leaf>[] ? `${Key}.*.${ExpandKey<Leaf, Node[Key][number]>}` | `${Key}.${number}.${ExpandKey<Leaf, Node[Key][number]>}` : Node[Key] extends ValidNode<Leaf> ? `${Key}.*` | `${Key}.${ExpandKey<Leaf, Node[Key]>}` : `${Key}`;
|
|
28
|
+
}[keyof Node & string];
|
|
29
|
+
/**
|
|
30
|
+
* Steps into `Node` via `Segment`
|
|
31
|
+
*
|
|
32
|
+
* @param Node some object
|
|
33
|
+
* @param Segment some path
|
|
34
|
+
*/
|
|
35
|
+
export type StepInto<Node, Segment extends string> = Node extends readonly (infer Item)[] ? Segment extends "*" | `${number}` ? Item : null : Segment extends "*" ? Node : Segment extends keyof Node & string ? Node[Segment] : null;
|
|
36
|
+
/**
|
|
37
|
+
* This type will undo {@link ExpandKey}.
|
|
38
|
+
*
|
|
39
|
+
* It does so by collapsing to the value that {@link tryWalk} will return for this path and node.
|
|
40
|
+
*
|
|
41
|
+
* @param Leaf a union of the the valid leaf types
|
|
42
|
+
* @param Node the object to resolve path from
|
|
43
|
+
* @param Path the path that should be resolved
|
|
44
|
+
*/
|
|
45
|
+
export type ResolvePath<Leaf, Node, Path extends string> = Path extends `${infer Head}.${infer Tail}` ? StepInto<Node, Head> extends infer Next ? Next extends null ? null : Head extends "*" ? WrapArray<ResolvePath<Leaf, Next, Tail>> : ResolvePath<Leaf, Next, Tail> : never : Path extends "*" ? Node extends readonly (infer Item)[] ? Item extends Leaf ? WrapArray<Item> : never : Node extends Leaf ? null : Node extends ValidNode<Leaf> ? {
|
|
46
|
+
[K in keyof Node]: Node[K];
|
|
47
|
+
} : null : StepInto<Node, Path> extends infer Leaf ? Leaf extends Leaf | readonly Leaf[] ? Leaf : null : never;
|
|
48
|
+
//# sourceMappingURL=nodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../src/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,SAAS,CAAC,IAAI;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GACjB,IAAI,GAAG,SAAS,IAAI,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;CAC7E;AAED;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,CAAC,IA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J,IAAI,SAAS,MAAM,IACnB,IAAI,SAAS,GAAG,MAAM,IAAI,IAAI,MAAM,IAAI,EAAE,GAExC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,MAAM,IAAI,GACnC,IAAI,SAAS,IAAI,GACb,IAAI,GACJ,IAAI,SAAS,GAAG,GAEd,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,GAExC,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GACnC,KAAK,GAET,IAAI,SAAS,GAAG,GAEd,IAAI,SAAS,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE,GAEhC,IAAI,SAAS,IAAI,GACb,SAAS,CAAC,IAAI,CAAC,GACf,KAAK,GACT,IAAI,SAAS,IAAI,GAEf,IAAI,GACJ,IAAI,SAAS,SAAS,CAAC,IAAI,CAAC,GAE1B;KAAG,CAAC,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;CAAE,GAE9B,IAAI,GAEZ,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,MAAM,IAAI,GACrC,IAAI,SAAS,IAAI,GAAG,SAAS,IAAI,EAAE,GAE/B,IAAI,GACJ,IAAI,GACR,KAAK,CAAC"}
|
package/dist/nodes.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes.js","sourceRoot":"","sources":["../src/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
2
|
+
"name": "@tobio0310/json-walker",
|
|
3
|
+
"author": {
|
|
4
|
+
"name": "Toby",
|
|
5
|
+
"url": "https://cv.tobysch.eu"
|
|
6
|
+
},
|
|
7
|
+
"version": "1.0.1",
|
|
8
|
+
"description": "A small TypeScript library for walking across a javascript object using string notation",
|
|
9
|
+
"homepage": "https://forgejo.tobysch.eu/tobiO0310/jsonWalker#readme",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://forgejo.tobysch.eu/tobiO0310/jsonWalker/issues"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://forgejo.tobysch.eu/tobiO0310/jsonWalker.git"
|
|
16
|
+
},
|
|
17
|
+
"type": "module",
|
|
18
|
+
"main": "./dist/index.cjs",
|
|
19
|
+
"module": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"directories": {
|
|
22
|
+
"test": "tests"
|
|
23
|
+
},
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js",
|
|
28
|
+
"require": "./dist/index.cjs"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsc -p tsconfig.app.json",
|
|
36
|
+
"test": "vitest",
|
|
37
|
+
"prepare": "npm run build",
|
|
38
|
+
"postversion": "git push origin main && git push --tags"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"typescript": "^7.0.2",
|
|
42
|
+
"vitest": "^5.1.2"
|
|
43
|
+
},
|
|
44
|
+
"allowScripts": {
|
|
45
|
+
"fsevents@2.3.3": true
|
|
46
|
+
}
|
|
47
|
+
}
|