Comparing version 2.1.5 to 2.1.6
@@ -80,3 +80,3 @@ "use strict"; | ||
process: input => this.process(input), | ||
run: (input, subContext) => this.run(input, Object.assign({}, context, subContext)), | ||
run: (input, subContext) => this.run(input, Object.assign(Object.assign({}, context), subContext)), | ||
usage: (command, opts) => this.usage(command, opts), | ||
@@ -83,0 +83,0 @@ }; |
@@ -20,3 +20,3 @@ "use strict"; | ||
exports.BATCH_REGEX = /^-[a-zA-Z]{2,}$/; | ||
exports.BINDING_REGEX = /^([^=]+)=(.*)$/; | ||
exports.BINDING_REGEX = /^([^=]+)=([\s\S]*)$/; | ||
// ------------------------------------------------------------------------ | ||
@@ -375,37 +375,37 @@ exports.DEBUG = process.env.DEBUG_CLI === `1`; | ||
setCandidateUsage: (state, segment, usage) => { | ||
return Object.assign({}, state, { candidateUsage: usage }); | ||
return Object.assign(Object.assign({}, state), { candidateUsage: usage }); | ||
}, | ||
setSelectedIndex: (state, segment, index) => { | ||
return Object.assign({}, state, { selectedIndex: index }); | ||
return Object.assign(Object.assign({}, state), { selectedIndex: index }); | ||
}, | ||
pushBatch: (state, segment) => { | ||
return Object.assign({}, state, { options: state.options.concat([...segment.slice(1)].map(name => ({ name: `-${name}`, value: true }))) }); | ||
return Object.assign(Object.assign({}, state), { options: state.options.concat([...segment.slice(1)].map(name => ({ name: `-${name}`, value: true }))) }); | ||
}, | ||
pushBound: (state, segment) => { | ||
const [, name, value] = segment.match(exports.BINDING_REGEX); | ||
return Object.assign({}, state, { options: state.options.concat({ name, value }) }); | ||
return Object.assign(Object.assign({}, state), { options: state.options.concat({ name, value }) }); | ||
}, | ||
pushPath: (state, segment) => { | ||
return Object.assign({}, state, { path: state.path.concat(segment) }); | ||
return Object.assign(Object.assign({}, state), { path: state.path.concat(segment) }); | ||
}, | ||
pushPositional: (state, segment) => { | ||
return Object.assign({}, state, { positionals: state.positionals.concat({ value: segment, extra: false }) }); | ||
return Object.assign(Object.assign({}, state), { positionals: state.positionals.concat({ value: segment, extra: false }) }); | ||
}, | ||
pushExtra: (state, segment) => { | ||
return Object.assign({}, state, { positionals: state.positionals.concat({ value: segment, extra: true }) }); | ||
return Object.assign(Object.assign({}, state), { positionals: state.positionals.concat({ value: segment, extra: true }) }); | ||
}, | ||
pushTrue: (state, segment, name = segment) => { | ||
return Object.assign({}, state, { options: state.options.concat({ name: segment, value: true }) }); | ||
return Object.assign(Object.assign({}, state), { options: state.options.concat({ name: segment, value: true }) }); | ||
}, | ||
pushFalse: (state, segment, name = segment) => { | ||
return Object.assign({}, state, { options: state.options.concat({ name, value: false }) }); | ||
return Object.assign(Object.assign({}, state), { options: state.options.concat({ name, value: false }) }); | ||
}, | ||
pushUndefined: (state, segment) => { | ||
return Object.assign({}, state, { options: state.options.concat({ name: segment, value: undefined }) }); | ||
return Object.assign(Object.assign({}, state), { options: state.options.concat({ name: segment, value: undefined }) }); | ||
}, | ||
setStringValue: (state, segment) => { | ||
return Object.assign({}, state, { options: state.options.slice(0, -1).concat(Object.assign({}, state.options[state.options.length - 1], { value: segment })) }); | ||
return Object.assign(Object.assign({}, state), { options: state.options.slice(0, -1).concat(Object.assign(Object.assign({}, state.options[state.options.length - 1]), { value: segment })) }); | ||
}, | ||
inhibateOptions: (state) => { | ||
return Object.assign({}, state, { ignoreOptions: true }); | ||
return Object.assign(Object.assign({}, state), { ignoreOptions: true }); | ||
}, | ||
@@ -415,6 +415,6 @@ useHelp: (state, segment, command) => { | ||
if (typeof index !== `undefined`) { | ||
return Object.assign({}, state, { options: [{ name: `-c`, value: String(command) }, { name: `-i`, value: index }] }); | ||
return Object.assign(Object.assign({}, state), { options: [{ name: `-c`, value: String(command) }, { name: `-i`, value: index }] }); | ||
} | ||
else { | ||
return Object.assign({}, state, { options: [{ name: `-c`, value: String(command) }] }); | ||
return Object.assign(Object.assign({}, state), { options: [{ name: `-c`, value: String(command) }] }); | ||
} | ||
@@ -424,6 +424,6 @@ }, | ||
if (segment === exports.END_OF_INPUT) { | ||
return Object.assign({}, state, { errorMessage: `${errorMessage}.` }); | ||
return Object.assign(Object.assign({}, state), { errorMessage: `${errorMessage}.` }); | ||
} | ||
else { | ||
return Object.assign({}, state, { errorMessage: `${errorMessage} ("${segment}").` }); | ||
return Object.assign(Object.assign({}, state), { errorMessage: `${errorMessage} ("${segment}").` }); | ||
} | ||
@@ -430,0 +430,0 @@ }, |
{ | ||
"name": "clipanion", | ||
"version": "2.1.5", | ||
"version": "2.1.6", | ||
"main": "lib/advanced", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
86361
16
0
243