Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const _replacer = (key, value) => {
if (_.isString(value) && DECIMAL_REGEX.test(value) &&
!isNaN(value) && parseFloat(value) > Number.MAX_SAFE_INTEGER) {
return new LosslessJSON.LosslessNumber(value.replace(/^\+/, ''))
} else if (value instanceof Decimal) {
return new LosslessJSON.LosslessNumber(value.toString())
} else {
return value
}
}
const _replacer = (key, value) => {
if (_.isString(value) && DECIMAL_REGEX.test(value) &&
!isNaN(value) && parseFloat(value) > Number.MAX_SAFE_INTEGER) {
return new LosslessJSON.LosslessNumber(value.replace(/^\+/, ''))
} else if (value instanceof Decimal) {
return new LosslessJSON.LosslessNumber(value.toString())
} else {
return value
}
}