node-convict
node-convict copied to clipboard
Add conf.toJson() method
Resolves #406
It simply uses the implementation of toString, including the sensitivity-censoring. Also, it changes toString to use toJson to keep it more dry.
A test is added too.
Coverage increased (+0.02%) to 93.225% when pulling db9247cbaa188385a0fb7ec7f80257af1dc73d79 on ath88:add-tojson-method into 9ca2d824a247e1579f1ef416119340ff76be5dd5 on mozilla:master.
Coverage increased (+0.02%) to 93.225% when pulling 4ce7882f33efb34a15f7a1e6211bf6e01fb3e89a on ath88:add-tojson-method into 9ca2d824a247e1579f1ef416119340ff76be5dd5 on mozilla:master.
Thanks @ath88 for making this PR - would love to be able to use this function instead of what we currently do JSON.parse(conf.toString()
Any maintainers available for a quick gander at this menial PR? :)