`hasOwnProperty(number)` can return true for strings.
This is unlikely to be the desired usage, and can mean that odd
responses are returned by nconf.
Disable trying to check `hasOwnProperty` of strings.
* argv store now accept a separator argument to create nested values
* remove stub file that shouldnt have been commited
* write a test to ensure separator is working well and use delete rather than undefined assign
* Added support for saving configuration to a specific file
Added support for saving configuration to a specific file
* add test to cover the save to file feature
* add posibility to specify a format to save to file
* add a test with nconf-yaml to ensure specifying a format works
The previous test was expecting the .match value to be a function rather than a regexp which is what the README shows. So I've fixed the code to match against a real regexp, and test if the stringified version of the regexp function is [object RegExp].
I've also updated the tests to prime the process.env with values that are specifically tested for to ensure it's correctly loading the env values.
Fixex indexzero/nconf#178
I stumbled over 2 slight problems of broken configuration files:
1) It said that a error in my JSON file existed (even though it was a yaml file, parsed by libyaml)
2) It didn't tell me which error occured.
both should be fixed with this PR
Previously, if the Memory store was merged with an object containing a null value, the following Error occurred:
TypeError: Object.keys called on non-object
at Function.keys (native)
at Memory.merge (/.../node_modules/nconf/lib/nconf/stores/memory.js:199:17)
at Memory.merge (/.../node_modules/nconf/lib/nconf/stores/memory.js:200:17)
at Array.every (native)
at Memory.merge (/.../node_modules/nconf/lib/nconf/stores/memory.js:199:29)
at common.merge (/.../node_modules/nconf/lib/nconf/common.js:99:13)
at Array.forEach (native)
at common.merge (/.../node_modules/nconf/lib/nconf/common.js:98:22)
at Array.forEach (native)
at Object.common.merge (/.../node_modules/nconf/lib/nconf/common.js:97:8)
This commit prevents that.