csv-parse
Advanced tools
Comparing version 4.4.5 to 4.4.6
@@ -10,2 +10,6 @@ | ||
## Version 4.4.6 | ||
* security: remove regexp vulnerable to DOS in cast option, npm report 69742 | ||
## Version 4.4.5 | ||
@@ -12,0 +16,0 @@ |
@@ -988,5 +988,3 @@ "use strict"; | ||
if (this.__isInt(field) === true) { | ||
return [undefined, parseInt(field)]; | ||
} else if (this.__isFloat(field)) { | ||
if (this.__isFloat(field)) { | ||
return [undefined, parseFloat(field)]; | ||
@@ -998,9 +996,10 @@ } else if (this.options.cast_date !== false) { | ||
return [undefined, field]; | ||
} | ||
} // Keep it in case we implement the `cast_int` option | ||
// __isInt(value){ | ||
// // return Number.isInteger(parseInt(value)) | ||
// // return !isNaN( parseInt( obj ) ); | ||
// return /^(\-|\+)?[1-9][0-9]*$/.test(value) | ||
// } | ||
}, { | ||
key: "__isInt", | ||
value: function __isInt(value) { | ||
return /^(\-|\+)?([1-9]+[0-9]*)$/.test(value); | ||
} | ||
}, { | ||
key: "__isFloat", | ||
@@ -1007,0 +1006,0 @@ value: function __isFloat(value) { |
@@ -750,5 +750,3 @@ | ||
} | ||
if(this.__isInt(field) === true){ | ||
return [undefined, parseInt(field)] | ||
}else if(this.__isFloat(field)){ | ||
if(this.__isFloat(field)){ | ||
return [undefined, parseFloat(field)] | ||
@@ -760,5 +758,8 @@ }else if(this.options.cast_date !== false){ | ||
} | ||
__isInt(value){ | ||
return /^(\-|\+)?([1-9]+[0-9]*)$/.test(value) | ||
} | ||
// Keep it in case we implement the `cast_int` option | ||
// __isInt(value){ | ||
// // return Number.isInteger(parseInt(value)) | ||
// // return !isNaN( parseInt( obj ) ); | ||
// return /^(\-|\+)?[1-9][0-9]*$/.test(value) | ||
// } | ||
__isFloat(value){ | ||
@@ -765,0 +766,0 @@ return (value - parseFloat( value ) + 1) >= 0 // Borrowed from jquery |
{ | ||
"version": "4.4.5", | ||
"version": "4.4.6", | ||
"name": "csv-parse", | ||
@@ -4,0 +4,0 @@ "description": "CSV parsing implementing the Node.js `stream.Transform` API", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115120
2404