You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

dashargs

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dashargs - npm Package Compare versions

Comparing version

to
4.0.1

2

package.json
{
"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 @@