Clean Argv Store options (#290)
* unset parse/transform from options and ensure they are not yargs options * use delete rather than undefined assignement
This commit is contained in:
parent
b9321b200a
commit
2bdf7e1a32
1 changed files with 13 additions and 2 deletions
|
@ -23,8 +23,19 @@ var Argv = exports.Argv = function (options, usage) {
|
||||||
this.readOnly = true;
|
this.readOnly = true;
|
||||||
this.options = options;
|
this.options = options;
|
||||||
this.usage = usage;
|
this.usage = usage;
|
||||||
this.parseValues = options.parseValues || false;
|
if(typeof options.parseValues === 'boolean') {
|
||||||
this.transform = options.transform || false;
|
this.parseValues = options.parseValues;
|
||||||
|
delete options.parseValues;
|
||||||
|
} else {
|
||||||
|
this.parseValues = false;
|
||||||
|
}
|
||||||
|
if (typeof options.transform === 'function') {
|
||||||
|
this.transform = options.transform;
|
||||||
|
delete options.transform;
|
||||||
|
} else {
|
||||||
|
this.transform = false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Inherit from the Memory store
|
// Inherit from the Memory store
|
||||||
|
|
Loading…
Reference in a new issue