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:
Adrien Becchis 2017-11-04 04:41:23 +01:00 committed by Matt Hamann
parent b9321b200a
commit 2bdf7e1a32

View file

@ -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