@fast-csv/format
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -114,3 +114,3 @@ "use strict"; | ||
// if we are not supposed to write the headers then | ||
// alwyas format the columns | ||
// always format the columns | ||
return { shouldFormatColumns: true, headers: null }; | ||
@@ -117,0 +117,0 @@ } |
@@ -15,2 +15,3 @@ import { Row, RowTransformFunction } from './types'; | ||
headers?: null | boolean | string[]; | ||
writeHeaders?: boolean; | ||
includeEndRowDelimiter?: boolean; | ||
@@ -17,0 +18,0 @@ writeBOM?: boolean; |
@@ -5,3 +5,3 @@ "use strict"; | ||
constructor(opts = {}) { | ||
var _a, _b, _c, _d; | ||
var _a, _b, _c, _d, _e; | ||
this.objectMode = true; | ||
@@ -32,3 +32,3 @@ this.delimiter = ','; | ||
} | ||
this.shouldWriteHeaders = !!this.headers; | ||
this.shouldWriteHeaders = !!this.headers && (_e = opts.writeHeaders, (_e !== null && _e !== void 0 ? _e : true)); | ||
this.headers = Array.isArray(this.headers) ? this.headers : null; | ||
@@ -35,0 +35,0 @@ this.escapedQuote = `${this.escape}${this.quote}`; |
{ | ||
"name": "@fast-csv/format", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "fast-csv formatting module", | ||
@@ -12,3 +12,3 @@ "keywords": [ | ||
"homepage": "http://c2fo.github.com/fast-csv/packages/format", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"main": "build/src/index.js", | ||
@@ -28,3 +28,4 @@ "types": "build/src/index.d.ts", | ||
"type": "git", | ||
"url": "git+https://github.com/C2FO/fast-csv.git" | ||
"url": "git+https://github.com/C2FO/fast-csv.git", | ||
"directory": "packages/format" | ||
}, | ||
@@ -53,3 +54,3 @@ "scripts": { | ||
}, | ||
"gitHead": "b0886a4a448ba2d8ee50ef64b6b528ae597c6487" | ||
"gitHead": "205cb22237a708a9a9cb3ef80422157c0c2a5b18" | ||
} |
@@ -61,2 +61,6 @@ # `@fast-csv/format` | ||
* **NOTE** If there are more headers than columns then additional empty columns will be added | ||
* `writeHeaders: {boolean} = true`: Set to false you dont want to write headers. | ||
* If `headers` is set to `true` and `writeHeaders` is `false` then any auto discovered headers will not be written in the output. | ||
* If `headers` is an `array` and `writeHeaders` is `false` then they will not be written. | ||
* **NOTE** This is can be used to append to an existing csv. | ||
* `alwaysWriteHeaders: {boolean} = false`: Set to true if you always want headers written, even if no rows are written. | ||
@@ -63,0 +67,0 @@ * **NOTE** This will throw an error if headers are not specified as an array. |
Sorry, the diff of this file is not supported yet
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
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
42894
0
489
257