command-line-args
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -26,3 +26,3 @@ 'use strict'; | ||
} else { | ||
argv = process.argv; | ||
argv = process.argv.slice(0); | ||
argv.splice(0, 2); | ||
@@ -29,0 +29,0 @@ } |
@@ -7,3 +7,2 @@ 'use strict'; | ||
require('core-js/es6/array'); | ||
var arrayify = require('array-back'); | ||
@@ -10,0 +9,0 @@ var o = require('object-tools'); |
var detect = require('feature-detect-es6') | ||
module.exports = detect.class() && detect.arrowFunction() && detect.newArrayFeatures() | ||
? require('./lib/command-line-args') | ||
: require('./es5/command-line-args') | ||
if (detect.class() && detect.arrowFunction() && detect.newArrayFeatures()) { | ||
module.exports = require('./lib/command-line-args') | ||
} else { | ||
require('core-js/es6/array') | ||
module.exports = require('./es5/command-line-args') | ||
} |
@@ -21,3 +21,3 @@ 'use strict' | ||
/* if no argv supplied, assume we are parsing process.argv */ | ||
argv = process.argv | ||
argv = process.argv.slice(0) | ||
argv.splice(0, 2) | ||
@@ -24,0 +24,0 @@ } |
'use strict' | ||
require('core-js/es6/array') | ||
var arrayify = require('array-back') | ||
@@ -4,0 +3,0 @@ var o = require('object-tools') |
{ | ||
"name": "command-line-args", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "A library to collect command-line args and generate a usage guide.", | ||
@@ -29,2 +29,3 @@ "repository": "https://github.com/75lb/command-line-args.git", | ||
"devDependencies": { | ||
"babel": "^5.8.29", | ||
"coveralls": "^2.11.4", | ||
@@ -31,0 +32,0 @@ "jsdoc-to-markdown": "^1.1.1", |
@@ -11,1 +11,10 @@ var test = require('tape') | ||
}) | ||
test('process.argv is left untouched', function (t) { | ||
process.argv = [ 'node', 'filename', '--one', 'eins' ] | ||
t.deepEqual(cliArgs({ name: 'one' }).parse(), { | ||
one: 'eins' | ||
}) | ||
t.deepEqual(process.argv, [ 'node', 'filename', '--one', 'eins' ]) | ||
t.end() | ||
}) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78506
1826
5