Skip to content

Commit

Permalink
Clean Argv Store options (#290)
Browse files Browse the repository at this point in the history
* unset parse/transform from options and ensure they are not yargs options

* use delete rather than undefined assignement
  • Loading branch information
AdrieanKhisbe authored and mhamann committed Nov 4, 2017
1 parent b9321b2 commit 2bdf7e1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/nconf/stores/argv.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2bdf7e1

Please sign in to comment.