Clean Argv Store options (#290)

* unset parse/transform from options and ensure they are not yargs options

* use delete rather than undefined assignement
master
Adrien Becchis 2017-11-04 04:41:23 +01:00 committed by Matt Hamann
parent b9321b200a
commit 2bdf7e1a32
1 changed files with 13 additions and 2 deletions

View File

@ -23,8 +23,19 @@ var Argv = exports.Argv = function (options, usage) {
this.readOnly = true;
this.options = options;
this.usage = usage;
this.parseValues = options.parseValues || false;
this.transform = options.transform || false;
if(typeof options.parseValues === 'boolean') {
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