@thi.ng/args 2.2.10 → 2.2.12
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 +8 -11
- package/api.d.ts +6 -6
- package/package.json +12 -12
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/args)
|
|
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.
|
|
@@ -22,7 +22,7 @@ This project is part of the
|
|
|
22
22
|
|
|
23
23
|
## About
|
|
24
24
|
|
|
25
|
-
Declarative, functional & typechecked CLI argument/options parser, value coercions etc
|
|
25
|
+
Declarative, functional & typechecked CLI argument/options parser, value coercions etc.
|
|
26
26
|
|
|
27
27
|
Includes built-in support for the following argument types (of course custom arg types are supported too):
|
|
28
28
|
|
|
@@ -64,14 +64,11 @@ ES module import:
|
|
|
64
64
|
|
|
65
65
|
For Node.js REPL:
|
|
66
66
|
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
node --experimental-repl-await
|
|
70
|
-
|
|
71
|
-
> const args = await import("@thi.ng/args");
|
|
67
|
+
```js
|
|
68
|
+
const args = await import("@thi.ng/args");
|
|
72
69
|
```
|
|
73
70
|
|
|
74
|
-
Package sizes (
|
|
71
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 2.29 KB
|
|
75
72
|
|
|
76
73
|
## Dependencies
|
|
77
74
|
|
|
@@ -218,7 +215,7 @@ ts-node index.ts \
|
|
|
218
215
|
|
|
219
216
|
## Authors
|
|
220
217
|
|
|
221
|
-
Karsten Schmidt
|
|
218
|
+
- [Karsten Schmidt](https://thi.ng)
|
|
222
219
|
|
|
223
220
|
If this project contributes to an academic publication, please cite it as:
|
|
224
221
|
|
|
@@ -233,4 +230,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
233
230
|
|
|
234
231
|
## License
|
|
235
232
|
|
|
236
|
-
© 2018 - 2022 Karsten Schmidt // Apache
|
|
233
|
+
© 2018 - 2022 Karsten Schmidt // Apache License 2.0
|
package/api.d.ts
CHANGED
|
@@ -29,13 +29,13 @@ export interface ArgSpecBase {
|
|
|
29
29
|
*/
|
|
30
30
|
group?: string;
|
|
31
31
|
}
|
|
32
|
-
export
|
|
32
|
+
export type ArgSpecRestrict<T> = undefined extends T ? {} : {
|
|
33
33
|
optional: false;
|
|
34
34
|
} | {
|
|
35
35
|
default: T;
|
|
36
36
|
};
|
|
37
|
-
export
|
|
38
|
-
export
|
|
37
|
+
export type ArgSpec<T> = ArgSpecBase & ArgSpecRestrict<T>;
|
|
38
|
+
export type ArgSpecExt = ArgSpec<any> & {
|
|
39
39
|
coerce?: Fn<any, any>;
|
|
40
40
|
delim?: string;
|
|
41
41
|
default?: any;
|
|
@@ -44,7 +44,7 @@ export declare type ArgSpecExt = ArgSpec<any> & {
|
|
|
44
44
|
multi?: boolean;
|
|
45
45
|
optional?: any;
|
|
46
46
|
};
|
|
47
|
-
export
|
|
47
|
+
export type Args<T extends IObjectOf<any>> = {
|
|
48
48
|
[id in keyof T]: boolean extends T[id] ? ArgSpec<T[id]> & {
|
|
49
49
|
flag: true;
|
|
50
50
|
} : any[] extends T[id] ? ArgSpec<T[id]> & {
|
|
@@ -61,8 +61,8 @@ export declare type Args<T extends IObjectOf<any>> = {
|
|
|
61
61
|
coerce: Fn<string, Exclude<T[id], undefined>>;
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
|
-
export
|
|
65
|
-
export
|
|
64
|
+
export type KVDict = IObjectOf<string>;
|
|
65
|
+
export type KVMultiDict = IObjectOf<string[]>;
|
|
66
66
|
export interface ParseResult<T> {
|
|
67
67
|
result: T;
|
|
68
68
|
index: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/args",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.12",
|
|
4
4
|
"description": "Declarative, functional & typechecked CLI argument/options parser, value coercions etc.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/thi-ng/umbrella.git"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://github.com/thi-ng/umbrella/tree/
|
|
13
|
+
"homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/args#readme",
|
|
14
14
|
"funding": [
|
|
15
15
|
{
|
|
16
16
|
"type": "github",
|
|
@@ -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/strings": "^3.3.
|
|
37
|
+
"@thi.ng/api": "^8.6.0",
|
|
38
|
+
"@thi.ng/checks": "^3.3.5",
|
|
39
|
+
"@thi.ng/errors": "^2.2.6",
|
|
40
|
+
"@thi.ng/strings": "^3.3.20"
|
|
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
|
"argument",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"thi.ng": {
|
|
97
97
|
"year": 2018
|
|
98
98
|
},
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "f445a9cc8022bcdebbf6ff91fd66ced016d72f01\n"
|
|
100
100
|
}
|