@trenskow/arguments-parser 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/lib/index.js +3 -3
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -12,7 +12,7 @@ import caseit from '@trenskow/caseit';
12
12
  import { default as isvalid, keyPaths, formalize } from 'isvalid';
13
13
  import print from '@trenskow/print';
14
14
 
15
- const argumentParser = ({ args = process.argv.slice(2), argvLevel = 0, placeholder = '<>' }) => {
15
+ const argumentsParser = ({ args = process.argv.slice(2), argvLevel = 0, placeholder = '<>' } = {}) => {
16
16
 
17
17
  const [ opening, closing ] = placeholder.split('');
18
18
 
@@ -78,7 +78,7 @@ const argumentParser = ({ args = process.argv.slice(2), argvLevel = 0, placehold
78
78
  args = args.slice(1);
79
79
  argvLevel++;
80
80
 
81
- return await commands[tool]({ args, argumentParser: argumentParser({ args, argvLevel, placeholder }) });
81
+ return await commands[tool]({ args, argumentsParser: argumentsParser({ args, argvLevel, placeholder }) });
82
82
 
83
83
  } catch (error) {
84
84
  print.err(`${error.stack}`);
@@ -233,4 +233,4 @@ const argumentParser = ({ args = process.argv.slice(2), argvLevel = 0, placehold
233
233
 
234
234
  };
235
235
 
236
- export default argumentParser;
236
+ export default argumentsParser;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trenskow/arguments-parser",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Yet another arguments parser.",
5
5
  "main": "index.js",
6
6
  "type": "module",