Closed jlimas closed 2 years ago
Hello @devinivy ! I did add a test case specifically for the issue I was having in #115
The test case below without the fix was returning undefined since it was evaluating if node.$default and since 0 evaluates to false it was assuming the node didn't have a $default property. I just changed the code to check if the variable is defined instead.
key12: {
zero: {
$env: 'ZERO',
$coerce: 'number',
$default: 0
}
},
get('/key12', { zero: 0 }, {}, [], {});
get('/key12', { zero: 1000 }, {}, [], { ZERO: '1000' });
Oh apologies, not sure how I missed that! Thanks 👍
No worries, really happy to help, I'm a big fan of this library.
Resolves #115
Thanks @devinivy for the publish and @jlimas for the quick fix. 💪
Thanks for the contribution! Could you add a test to ensure we're fixing the case you described in #115?