@thi.ng/args 2.1.5 → 2.1.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2022-03-11T12:13:49Z
3
+ - **Last updated**: 2022-04-07T14:17:30Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [2.1.6](https://github.com/thi-ng/umbrella/tree/@thi.ng/args@2.1.6) (2022-04-07)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - replace deprecated .substr() w/ .substring() ([0710509](https://github.com/thi-ng/umbrella/commit/0710509))
17
+
12
18
  ## [2.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/args@2.1.0) (2021-11-17)
13
19
 
14
20
  #### 🚀 Features
package/coerce.js CHANGED
@@ -20,8 +20,8 @@ export function coerceKV(delim = "=", strict = false, multi = false) {
20
20
  idx < 1 &&
21
21
  illegalArgs(`got '${x}', but expected a 'key${delim}value' pair`);
22
22
  if (idx > 0) {
23
- const id = x.substr(0, idx);
24
- const val = x.substr(idx + 1);
23
+ const id = x.substring(0, idx);
24
+ const val = x.substring(idx + 1);
25
25
  if (multi) {
26
26
  acc[id] ? acc[id].push(val) : (acc[id] = [val]);
27
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/args",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "Declarative, functional & typechecked CLI argument/options parser, value coercions etc.",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -34,14 +34,14 @@
34
34
  "test": "testament test"
35
35
  },
36
36
  "dependencies": {
37
- "@thi.ng/api": "^8.3.4",
38
- "@thi.ng/checks": "^3.1.4",
39
- "@thi.ng/errors": "^2.1.4",
40
- "@thi.ng/strings": "^3.3.2"
37
+ "@thi.ng/api": "^8.3.5",
38
+ "@thi.ng/checks": "^3.1.5",
39
+ "@thi.ng/errors": "^2.1.5",
40
+ "@thi.ng/strings": "^3.3.3"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@microsoft/api-extractor": "^7.19.4",
44
- "@thi.ng/testament": "^0.2.4",
44
+ "@thi.ng/testament": "^0.2.5",
45
45
  "rimraf": "^3.0.2",
46
46
  "tools": "^0.0.1",
47
47
  "typedoc": "^0.22.13",
@@ -75,26 +75,26 @@
75
75
  ],
76
76
  "exports": {
77
77
  ".": {
78
- "import": "./index.js"
78
+ "default": "./index.js"
79
79
  },
80
80
  "./api": {
81
- "import": "./api.js"
81
+ "default": "./api.js"
82
82
  },
83
83
  "./args": {
84
- "import": "./args.js"
84
+ "default": "./args.js"
85
85
  },
86
86
  "./coerce": {
87
- "import": "./coerce.js"
87
+ "default": "./coerce.js"
88
88
  },
89
89
  "./parse": {
90
- "import": "./parse.js"
90
+ "default": "./parse.js"
91
91
  },
92
92
  "./usage": {
93
- "import": "./usage.js"
93
+ "default": "./usage.js"
94
94
  }
95
95
  },
96
96
  "thi.ng": {
97
97
  "year": 2018
98
98
  },
99
- "gitHead": "0fc692a3225c068aacafdc4cb6140cf603c67ad8\n"
99
+ "gitHead": "5ee1feb590dd935593b1dd4e7f38a3ed3ba64765\n"
100
100
  }
package/parse.js CHANGED
@@ -57,10 +57,10 @@ const parseKey = (specs, aliases, acc, a) => {
57
57
  // terminator arg, stop parsing
58
58
  if (a === "--")
59
59
  return { state: 1 };
60
- id = camel(a.substr(2));
60
+ id = camel(a.substring(2));
61
61
  }
62
62
  else {
63
- id = aliases[a.substr(1)];
63
+ id = aliases[a.substring(1)];
64
64
  !id && illegalArgs(`unknown option: ${a}`);
65
65
  }
66
66
  const spec = specs[id];