Comparing version
{ | ||
"name": "dashargs", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Simple package for parsing command line style arguments", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.cjs", |
const { Options } = require('../options'); | ||
const parse = require('./parse.js'); | ||
const { Parser } = require('../structures'); | ||
@@ -15,3 +15,3 @@ /** | ||
const args = parse(string, { | ||
const parser = new Parser(string, { | ||
typeCoerce: false, | ||
@@ -22,8 +22,10 @@ unique: false, | ||
prefix: options.prefix, | ||
}) | ||
.array() | ||
.map((x) => (options.removeWhitespace ? ' ' : '') + x.raw.trim()); | ||
}); | ||
for (const raw of args) { | ||
string = string.replace(raw, '').replace(raw.trim(), ''); | ||
const parsed = parser | ||
.parse() | ||
.map(({ raw }) => (options.removeWhitespace ? ' ' : '') + raw.trim()); | ||
for (const item of parsed) { | ||
string = string.replace(item, ''); | ||
} | ||
@@ -30,0 +32,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
22386
0.12%547
0.18%0
-100%