@thi.ng/resolve-map 7.1.16 → 7.1.18
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/CHANGELOG.md +1 -1
- package/README.md +7 -10
- package/index.d.ts +6 -5
- package/index.js +7 -5
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
2
|
|
|
3
|
-
# 
|
|
3
|
+
# 
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@thi.ng/resolve-map)
|
|
6
6
|

|
|
7
|
-
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
This project is part of the
|
|
10
10
|
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
|
|
@@ -25,7 +25,7 @@ This project is part of the
|
|
|
25
25
|
|
|
26
26
|
## About
|
|
27
27
|
|
|
28
|
-
DAG resolution of vanilla objects & arrays with internally linked values
|
|
28
|
+
DAG resolution of vanilla objects & arrays with internally linked values
|
|
29
29
|
|
|
30
30
|
This is useful for expressing complex configurations with
|
|
31
31
|
derived values or computing interrelated values without having to
|
|
@@ -69,11 +69,8 @@ ES module import:
|
|
|
69
69
|
|
|
70
70
|
For Node.js REPL:
|
|
71
71
|
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
node --experimental-repl-await
|
|
75
|
-
|
|
76
|
-
> const resolveMap = await import("@thi.ng/resolve-map");
|
|
72
|
+
```js
|
|
73
|
+
const resolveMap = await import("@thi.ng/resolve-map");
|
|
77
74
|
```
|
|
78
75
|
|
|
79
76
|
Package sizes (brotli'd, pre-treeshake): ESM: 1.01 KB
|
|
@@ -336,7 +333,7 @@ resolve({ a: "@c", b: ({a}) => a, c: 42 }, { onlyFnRefs: true })
|
|
|
336
333
|
|
|
337
334
|
## Authors
|
|
338
335
|
|
|
339
|
-
Karsten Schmidt
|
|
336
|
+
- [Karsten Schmidt](https://thi.ng)
|
|
340
337
|
|
|
341
338
|
If this project contributes to an academic publication, please cite it as:
|
|
342
339
|
|
|
@@ -351,4 +348,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
351
348
|
|
|
352
349
|
## License
|
|
353
350
|
|
|
354
|
-
© 2018 - 2022 Karsten Schmidt // Apache
|
|
351
|
+
© 2018 - 2022 Karsten Schmidt // Apache License 2.0
|
package/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Fn, IDeref, NumOrString } from "@thi.ng/api";
|
|
2
|
-
export
|
|
2
|
+
export type Unresolved<T> = {
|
|
3
3
|
[K in keyof T]: Unresolved<T[K]> | Resolved<T[K]> | Fn<T, T[K]> | Fn<ResolveFn, T[K]> | Function | string;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type ResolveFn = (path: string) => any;
|
|
6
|
+
export type LookupPath = NumOrString[];
|
|
7
7
|
export interface ResolveOpts {
|
|
8
8
|
/**
|
|
9
9
|
* Prefix for auto-recognizing & interpreting embedded string values as
|
|
@@ -141,8 +141,9 @@ export declare class Resolved<T> implements IDeref<T> {
|
|
|
141
141
|
/**
|
|
142
142
|
* Factory function for {@link Resolved} to wrap & protect values from further
|
|
143
143
|
* resolution attempts. The wrapped value can be later obtained via the standard
|
|
144
|
-
*
|
|
145
|
-
*
|
|
144
|
+
* [`IDeref`](https://docs.thi.ng/umbrella/api/interfaces/IDeref.html)
|
|
145
|
+
* interface/mechanism. In lookup functions, the unwrapped value will be
|
|
146
|
+
* supplied, no `.deref()` necessary there.
|
|
146
147
|
*
|
|
147
148
|
* @param val
|
|
148
149
|
*/
|
package/index.js
CHANGED
|
@@ -224,16 +224,18 @@ export class Resolved {
|
|
|
224
224
|
/**
|
|
225
225
|
* Factory function for {@link Resolved} to wrap & protect values from further
|
|
226
226
|
* resolution attempts. The wrapped value can be later obtained via the standard
|
|
227
|
-
*
|
|
228
|
-
*
|
|
227
|
+
* [`IDeref`](https://docs.thi.ng/umbrella/api/interfaces/IDeref.html)
|
|
228
|
+
* interface/mechanism. In lookup functions, the unwrapped value will be
|
|
229
|
+
* supplied, no `.deref()` necessary there.
|
|
229
230
|
*
|
|
230
231
|
* @param val
|
|
231
232
|
*/
|
|
232
233
|
export const resolved = (val) => new Resolved(val);
|
|
233
234
|
/**
|
|
234
|
-
* Special version of
|
|
235
|
-
*
|
|
236
|
-
*
|
|
235
|
+
* Special version of
|
|
236
|
+
* [`getInUnsafe()`](https://docs.thi.ng/umbrella/paths/functions/getInUnsafe.html)
|
|
237
|
+
* with extra support for intermediate wrapped {@link Resolved} values and
|
|
238
|
+
* returning tuple of: `[val,isResolved]`.
|
|
237
239
|
*
|
|
238
240
|
* @param obj
|
|
239
241
|
* @param path
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/resolve-map",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.18",
|
|
4
4
|
"description": "DAG resolution of vanilla objects & arrays with internally linked values",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"url": "https://patreon.com/thing_umbrella"
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
|
-
"author": "Karsten Schmidt
|
|
24
|
+
"author": "Karsten Schmidt (https://thi.ng)",
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "yarn clean && tsc --declaration",
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.
|
|
38
|
-
"@thi.ng/checks": "^3.3.
|
|
39
|
-
"@thi.ng/errors": "^2.2.
|
|
40
|
-
"@thi.ng/paths": "^5.1.
|
|
37
|
+
"@thi.ng/api": "^8.6.1",
|
|
38
|
+
"@thi.ng/checks": "^3.3.5",
|
|
39
|
+
"@thi.ng/errors": "^2.2.6",
|
|
40
|
+
"@thi.ng/paths": "^5.1.26"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@microsoft/api-extractor": "^7.33.
|
|
44
|
-
"@thi.ng/testament": "^0.3.
|
|
43
|
+
"@microsoft/api-extractor": "^7.33.7",
|
|
44
|
+
"@thi.ng/testament": "^0.3.7",
|
|
45
45
|
"rimraf": "^3.0.2",
|
|
46
46
|
"tools": "^0.0.1",
|
|
47
|
-
"typedoc": "^0.23.
|
|
48
|
-
"typescript": "^4.
|
|
47
|
+
"typedoc": "^0.23.22",
|
|
48
|
+
"typescript": "^4.9.4"
|
|
49
49
|
},
|
|
50
50
|
"keywords": [
|
|
51
51
|
"configuration",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
],
|
|
77
77
|
"year": 2018
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
|
|
80
80
|
}
|