You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parseValues option of .env method doesn't return the expected value on long numbers (greater than Number.MAX_SAFE_INTEGER).
For example, '123456123456123456', will return 123456123456123460.
This is due to javascript handling and not nconf.
To prevent this kind of problems, wouldn't it be a good thing to make sure that a numeric like env variable can be cast back to its original string value ?
i.e. in
common.parseValues = function (value) {
var val = value;
try {
const castValue = JSON.parse(value);
if (JSON.stringify(castValue) !== value) {
throw "ignored";
}
val = castValue;
} catch (ignore) {
// Check for any other well-known strings that should be "parsed"
if (value === 'undefined'){
val = void 0;
}
}
return val;
};
What do you think ?
The text was updated successfully, but these errors were encountered:
The parseValues option of .env method doesn't return the expected value on long numbers (greater than Number.MAX_SAFE_INTEGER).
For example, '123456123456123456', will return 123456123456123460.
This is due to javascript handling and not nconf.
To prevent this kind of problems, wouldn't it be a good thing to make sure that a numeric like env variable can be cast back to its original string value ?
i.e. in
nconf/lib/nconf/common.js
Line 134 in b9321b2
do something like:
What do you think ?
The text was updated successfully, but these errors were encountered: