csv-stringify
Advanced tools
Comparing version 5.4.3 to 5.5.0
# Changelog | ||
## Version 5.5.0 | ||
Feature: | ||
* cast: support for BigInt | ||
## Version 5.4.3 | ||
@@ -5,0 +10,0 @@ |
@@ -249,5 +249,13 @@ "use strict"; | ||
} else {} // todo | ||
// Normalize option cast.boolean | ||
// Normalize option cast.bigint | ||
if (options.cast.bigint === undefined || options.cast.bigint === null) { | ||
// Cast boolean to string by default | ||
options.cast.bigint = function (value) { | ||
return '' + value; | ||
}; | ||
} // Normalize option cast.boolean | ||
if (options.cast["boolean"] === undefined || options.cast["boolean"] === null) { | ||
@@ -631,2 +639,4 @@ // Cast boolean to string by default | ||
return [undefined, this.options.cast.string(value, context)]; | ||
} else if (type === 'bigint') { | ||
return [undefined, this.options.cast.bigint(value, context)]; | ||
} else if (type === 'number') { | ||
@@ -633,0 +643,0 @@ return [undefined, this.options.cast.number(value, context)]; |
@@ -163,2 +163,7 @@ | ||
} | ||
// Normalize option cast.bigint | ||
if(options.cast.bigint === undefined || options.cast.bigint === null){ | ||
// Cast boolean to string by default | ||
options.cast.bigint = value => '' + value | ||
} | ||
// Normalize option cast.boolean | ||
@@ -402,2 +407,4 @@ if(options.cast.boolean === undefined || options.cast.boolean === null){ | ||
return [undefined, this.options.cast.string(value, context)] | ||
}else if(type === 'bigint'){ | ||
return [undefined, this.options.cast.bigint(value, context)] | ||
}else if(type === 'number'){ | ||
@@ -404,0 +411,0 @@ return [undefined, this.options.cast.number(value, context)] |
{ | ||
"version": "5.4.3", | ||
"version": "5.5.0", | ||
"name": "csv-stringify", | ||
@@ -4,0 +4,0 @@ "description": "CSV stringifier implementing the Node.js `stream.Transform` API", |
73579
1651