node-convict icon indicating copy to clipboard operation
node-convict copied to clipboard

Add conf.toJson() method

Open ath88 opened this issue 3 years ago • 4 comments

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.

ath88 avatar Oct 03 '22 13:10 ath88

Coverage Status

Coverage increased (+0.02%) to 93.225% when pulling db9247cbaa188385a0fb7ec7f80257af1dc73d79 on ath88:add-tojson-method into 9ca2d824a247e1579f1ef416119340ff76be5dd5 on mozilla:master.

coveralls avatar Oct 03 '22 13:10 coveralls

Coverage Status

Coverage increased (+0.02%) to 93.225% when pulling 4ce7882f33efb34a15f7a1e6211bf6e01fb3e89a on ath88:add-tojson-method into 9ca2d824a247e1579f1ef416119340ff76be5dd5 on mozilla:master.

coveralls avatar Oct 03 '22 13:10 coveralls

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()

SidSethi avatar Nov 07 '22 20:11 SidSethi

Any maintainers available for a quick gander at this menial PR? :)

ath88 avatar Nov 16 '22 10:11 ath88