diff --git a/demo/browser/CHANGELOG.md b/demo/browser/CHANGELOG.md index e7970da5..d8da3d58 100644 --- a/demo/browser/CHANGELOG.md +++ b/demo/browser/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.13](https://github.com/adaltas/node-csv/compare/csv-demo-browser@0.1.12...csv-demo-browser@0.1.13) (2023-08-25) + +**Note:** Version bump only for package csv-demo-browser + + + + + ## [0.1.12](https://github.com/adaltas/node-csv/compare/csv-demo-browser@0.1.11...csv-demo-browser@0.1.12) (2023-08-24) **Note:** Version bump only for package csv-demo-browser diff --git a/demo/browser/package.json b/demo/browser/package.json index f39e9c5b..1e79f0e3 100644 --- a/demo/browser/package.json +++ b/demo/browser/package.json @@ -1,6 +1,6 @@ { "name": "csv-demo-browser", - "version": "0.1.12", + "version": "0.1.13", "main": "index.js", "license": "MIT", "type": "module", @@ -20,11 +20,11 @@ "start": "node server.js" }, "dependencies": { - "csv": "^6.3.2", - "csv-generate": "^4.2.7", - "csv-parse": "^5.4.1", - "csv-stringify": "^6.4.1", + "csv": "^6.3.3", + "csv-generate": "^4.2.8", + "csv-parse": "^5.5.0", + "csv-stringify": "^6.4.2", "express": "^4.18.2", - "stream-transform": "^3.2.7" + "stream-transform": "^3.2.8" } } diff --git a/demo/cjs/CHANGELOG.md b/demo/cjs/CHANGELOG.md index 0d03a592..a6c69c1e 100644 --- a/demo/cjs/CHANGELOG.md +++ b/demo/cjs/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.11](https://github.com/adaltas/node-csv/compare/csv-demo-cjs@0.2.10...csv-demo-cjs@0.2.11) (2023-08-25) + + +### Bug Fixes + +* **csv-demo-ts-cjs-node16:** upgrade module definition after latest typescript ([87fe919](https://github.com/adaltas/node-csv/commit/87fe91996fb2a8895c252177fca4f0cb59a518f9)) + + + ## [0.2.10](https://github.com/adaltas/node-csv/compare/csv-demo-cjs@0.2.9...csv-demo-cjs@0.2.10) (2023-08-24) **Note:** Version bump only for package csv-demo-cjs diff --git a/demo/cjs/package.json b/demo/cjs/package.json index ceebcc25..8d6f2cd0 100644 --- a/demo/cjs/package.json +++ b/demo/cjs/package.json @@ -1,14 +1,14 @@ { "name": "csv-demo-cjs", - "version": "0.2.10", + "version": "0.2.11", "main": "index.js", "license": "MIT", "type": "commonjs", "private": true, "dependencies": { - "csv": "^6.3.2", - "csv-parse": "^5.4.1", - "csv-stringify": "^6.4.1" + "csv": "^6.3.3", + "csv-parse": "^5.5.0", + "csv-stringify": "^6.4.2" }, "devDependencies": { "@types/node": "^20.5.6", diff --git a/demo/eslint/CHANGELOG.md b/demo/eslint/CHANGELOG.md index f266406d..f7ce5da2 100644 --- a/demo/eslint/CHANGELOG.md +++ b/demo/eslint/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.16](https://github.com/adaltas/node-csv/compare/csv-demo-eslint@0.1.15...csv-demo-eslint@0.1.16) (2023-08-25) + + +### Bug Fixes + +* **csv-demo-ts-cjs-node16:** upgrade module definition after latest typescript ([87fe919](https://github.com/adaltas/node-csv/commit/87fe91996fb2a8895c252177fca4f0cb59a518f9)) + + + ## [0.1.15](https://github.com/adaltas/node-csv/compare/csv-demo-eslint@0.1.14...csv-demo-eslint@0.1.15) (2023-08-24) diff --git a/demo/eslint/package.json b/demo/eslint/package.json index 35355277..ba1a22d6 100644 --- a/demo/eslint/package.json +++ b/demo/eslint/package.json @@ -1,6 +1,6 @@ { "name": "csv-demo-eslint", - "version": "0.1.15", + "version": "0.1.16", "description": "", "main": "index.js", "private": true, @@ -10,7 +10,7 @@ }, "license": "MIT", "dependencies": { - "csv-stringify": "^6.4.1" + "csv-stringify": "^6.4.2" }, "devDependencies": { "eslint": "^8.47.0", diff --git a/demo/esm/CHANGELOG.md b/demo/esm/CHANGELOG.md index a734e60b..ae50457d 100644 --- a/demo/esm/CHANGELOG.md +++ b/demo/esm/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.0.25](https://github.com/adaltas/node-csv/compare/csv-demo-esm@0.0.24...csv-demo-esm@0.0.25) (2023-08-25) + +**Note:** Version bump only for package csv-demo-esm + + + + + ## [0.0.24](https://github.com/adaltas/node-csv/compare/csv-demo-esm@0.0.23...csv-demo-esm@0.0.24) (2023-08-24) **Note:** Version bump only for package csv-demo-esm diff --git a/demo/esm/package.json b/demo/esm/package.json index 04813c25..62be1dd1 100644 --- a/demo/esm/package.json +++ b/demo/esm/package.json @@ -1,13 +1,13 @@ { "name": "csv-demo-esm", - "version": "0.0.24", + "version": "0.0.25", "main": "index.js", "license": "MIT", "type": "module", "private": true, "dependencies": { - "csv": "^6.3.2", - "csv-parse": "^5.4.1" + "csv": "^6.3.3", + "csv-parse": "^5.5.0" }, "devDependencies": { "coffeescript": "^2.7.0", diff --git a/demo/issues-cjs/CHANGELOG.md b/demo/issues-cjs/CHANGELOG.md index 70ed5a5c..e4e1d9e1 100644 --- a/demo/issues-cjs/CHANGELOG.md +++ b/demo/issues-cjs/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.0](https://github.com/adaltas/node-csv/compare/csv-issues-cjs@0.1.11...csv-issues-cjs@0.2.0) (2023-08-25) + + +### Features + +* **csv-issues-cjs:** 399 issue ([b8df8db](https://github.com/adaltas/node-csv/commit/b8df8dbf071021aa398ea82dbe650ab3e7b16a0b)) + + + ## [0.1.11](https://github.com/adaltas/node-csv/compare/csv-issues-cjs@0.1.10...csv-issues-cjs@0.1.11) (2023-08-24) **Note:** Version bump only for package csv-issues-cjs diff --git a/demo/issues-cjs/package.json b/demo/issues-cjs/package.json index 5861d788..7fce2cd3 100644 --- a/demo/issues-cjs/package.json +++ b/demo/issues-cjs/package.json @@ -1,12 +1,12 @@ { "name": "csv-issues-cjs", - "version": "0.1.11", + "version": "0.2.0", "main": "index.js", "license": "MIT", "private": true, "dependencies": { - "csv-parse": "^5.4.1", - "csv-stringify": "^6.4.1" + "csv-parse": "^5.5.0", + "csv-stringify": "^6.4.2" }, "devDependencies": { "coffeescript": "^2.7.0", diff --git a/demo/issues-esm/CHANGELOG.md b/demo/issues-esm/CHANGELOG.md index 748d45c2..75b0af7c 100644 --- a/demo/issues-esm/CHANGELOG.md +++ b/demo/issues-esm/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.0.16](https://github.com/adaltas/node-csv/compare/csv-issues-esm@0.0.15...csv-issues-esm@0.0.16) (2023-08-25) + +**Note:** Version bump only for package csv-issues-esm + + + + + ## [0.0.15](https://github.com/adaltas/node-csv/compare/csv-issues-esm@0.0.14...csv-issues-esm@0.0.15) (2023-08-24) **Note:** Version bump only for package csv-issues-esm diff --git a/demo/issues-esm/package.json b/demo/issues-esm/package.json index 6e35a8db..ad362abb 100644 --- a/demo/issues-esm/package.json +++ b/demo/issues-esm/package.json @@ -1,6 +1,6 @@ { "name": "csv-issues-esm", - "version": "0.0.15", + "version": "0.0.16", "main": "index.js", "license": "MIT", "type": "module", @@ -26,9 +26,9 @@ "test": "mocha 'test/**/*.coffee'" }, "dependencies": { - "csv-generate": "^4.2.7", - "csv-parse": "^5.4.1", - "csv-stringify": "^6.4.1", + "csv-generate": "^4.2.8", + "csv-parse": "^5.5.0", + "csv-stringify": "^6.4.2", "desm": "^1.3.0" } } diff --git a/demo/ts-cjs-node16/CHANGELOG.md b/demo/ts-cjs-node16/CHANGELOG.md index a7503be3..d3ff6f77 100644 --- a/demo/ts-cjs-node16/CHANGELOG.md +++ b/demo/ts-cjs-node16/CHANGELOG.md @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 0.2.11 (2023-08-25) + + +### Bug Fixes + +* **csv-demo-ts-cjs-node16:** upgrade module definition after latest typescript ([87fe919](https://github.com/adaltas/node-csv/commit/87fe91996fb2a8895c252177fca4f0cb59a518f9)) +* support ts node16 resolution in cjs ([#354](https://github.com/adaltas/node-csv/issues/354)) ([fa09d03](https://github.com/adaltas/node-csv/commit/fa09d03aaf0008b2790656871ca6b2c4be12d14c)) + + + ## [0.2.10](https://github.com/adaltas/node-csv/compare/csv-demo-ts-moduleresolution-node16-cjs@0.2.9...csv-demo-ts-moduleresolution-node16-cjs@0.2.10) (2023-08-24) **Note:** Version bump only for package csv-demo-ts-moduleresolution-node16-cjs diff --git a/demo/ts-cjs-node16/package.json b/demo/ts-cjs-node16/package.json index b968aae9..3b6fdef8 100644 --- a/demo/ts-cjs-node16/package.json +++ b/demo/ts-cjs-node16/package.json @@ -1,11 +1,11 @@ { "name": "csv-demo-ts-cjs-node16", - "version": "0.2.10", + "version": "0.2.11", "dependencies": { - "csv-generate": "^4.2.7", - "csv-parse": "^5.4.1", - "csv-stringify": "^6.4.1", - "stream-transform": "^3.2.7" + "csv-generate": "^4.2.8", + "csv-parse": "^5.5.0", + "csv-stringify": "^6.4.2", + "stream-transform": "^3.2.8" }, "main": "index.js", "license": "MIT", diff --git a/demo/ts-esm-node16/CHANGELOG.md b/demo/ts-esm-node16/CHANGELOG.md index 3536e5a1..62a3fb55 100644 --- a/demo/ts-esm-node16/CHANGELOG.md +++ b/demo/ts-esm-node16/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.11](https://github.com/adaltas/node-csv/compare/csv-demo-ts-module-node16@0.2.10...csv-demo-ts-module-node16@0.2.11) (2023-08-25) + + +### Bug Fixes + +* **csv-demo-ts-cjs-node16:** upgrade module definition after latest typescript ([87fe919](https://github.com/adaltas/node-csv/commit/87fe91996fb2a8895c252177fca4f0cb59a518f9)) + + + ## [0.2.10](https://github.com/adaltas/node-csv/compare/csv-demo-ts-module-node16@0.2.9...csv-demo-ts-module-node16@0.2.10) (2023-08-24) **Note:** Version bump only for package csv-demo-ts-module-node16 diff --git a/demo/ts-esm-node16/package.json b/demo/ts-esm-node16/package.json index d4f7ef5e..e69c7aa7 100644 --- a/demo/ts-esm-node16/package.json +++ b/demo/ts-esm-node16/package.json @@ -1,15 +1,15 @@ { "name": "csv-demo-ts-module-node16", - "version": "0.2.10", + "version": "0.2.11", "main": "index.js", "license": "MIT", "type": "module", "private": true, "dependencies": { - "csv-generate": "^4.2.7", - "csv-parse": "^5.4.1", - "csv-stringify": "^6.4.1", - "stream-transform": "^3.2.7" + "csv-generate": "^4.2.8", + "csv-parse": "^5.5.0", + "csv-stringify": "^6.4.2", + "stream-transform": "^3.2.8" }, "devDependencies": { "@types/node": "^20.5.6", diff --git a/demo/webpack-ts/CHANGELOG.md b/demo/webpack-ts/CHANGELOG.md index 4ba2221c..675c8b30 100644 --- a/demo/webpack-ts/CHANGELOG.md +++ b/demo/webpack-ts/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.13](https://github.com/adaltas/node-csv/compare/csv-demo-webpack-ts@0.1.12...csv-demo-webpack-ts@0.1.13) (2023-08-25) + + +### Bug Fixes + +* **csv-demo-ts-cjs-node16:** upgrade module definition after latest typescript ([87fe919](https://github.com/adaltas/node-csv/commit/87fe91996fb2a8895c252177fca4f0cb59a518f9)) + + + ## [0.1.12](https://github.com/adaltas/node-csv/compare/csv-demo-webpack-ts@0.1.11...csv-demo-webpack-ts@0.1.12) (2023-08-24) **Note:** Version bump only for package csv-demo-webpack-ts diff --git a/demo/webpack-ts/package.json b/demo/webpack-ts/package.json index ab362f42..14f53107 100644 --- a/demo/webpack-ts/package.json +++ b/demo/webpack-ts/package.json @@ -1,17 +1,17 @@ { "name": "csv-demo-webpack-ts", - "version": "0.1.12", + "version": "0.1.13", "description": "", "private": true, "keywords": [], "author": "", "license": "ISC", "dependencies": { - "csv-generate": "^4.2.7", - "csv-parse": "^5.4.1", - "csv-stringify": "^6.4.1", + "csv-generate": "^4.2.8", + "csv-parse": "^5.5.0", + "csv-stringify": "^6.4.2", "http-server": "^14.1.1", - "stream-transform": "^3.2.7" + "stream-transform": "^3.2.8" }, "devDependencies": { "buffer-browserify": "^0.2.5", diff --git a/demo/webpack/CHANGELOG.md b/demo/webpack/CHANGELOG.md index c135fc1f..1992c186 100644 --- a/demo/webpack/CHANGELOG.md +++ b/demo/webpack/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.15](https://github.com/adaltas/node-csv/compare/csv-demo-webpack@0.1.14...csv-demo-webpack@0.1.15) (2023-08-25) + +**Note:** Version bump only for package csv-demo-webpack + + + + + ## [0.1.14](https://github.com/adaltas/node-csv/compare/csv-demo-webpack@0.1.13...csv-demo-webpack@0.1.14) (2023-08-24) **Note:** Version bump only for package csv-demo-webpack diff --git a/demo/webpack/package.json b/demo/webpack/package.json index cb061dbd..aa12f77a 100644 --- a/demo/webpack/package.json +++ b/demo/webpack/package.json @@ -1,6 +1,6 @@ { "name": "csv-demo-webpack", - "version": "0.1.14", + "version": "0.1.15", "description": "", "private": true, "scripts": { @@ -16,12 +16,12 @@ "webpack-cli": "^5.1.4" }, "dependencies": { - "csv": "^6.3.2", - "csv-generate": "^4.2.7", - "csv-parse": "^5.4.1", - "csv-stringify": "^6.4.1", + "csv": "^6.3.3", + "csv-generate": "^4.2.8", + "csv-parse": "^5.5.0", + "csv-stringify": "^6.4.2", "http-server": "^14.1.1", "stream-browserify": "^3.0.0", - "stream-transform": "^3.2.7" + "stream-transform": "^3.2.8" } } diff --git a/packages/csv-generate/CHANGELOG.md b/packages/csv-generate/CHANGELOG.md index d84e9739..dcc99a10 100644 --- a/packages/csv-generate/CHANGELOG.md +++ b/packages/csv-generate/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.2.8](https://github.com/adaltas/node-csv/compare/csv-generate@4.2.7...csv-generate@4.2.8) (2023-08-25) + + +### Bug Fixes + +* **csv-demo-ts-cjs-node16:** upgrade module definition after latest typescript ([87fe919](https://github.com/adaltas/node-csv/commit/87fe91996fb2a8895c252177fca4f0cb59a518f9)) + + + ## [4.2.7](https://github.com/adaltas/node-csv/compare/csv-generate@4.2.6...csv-generate@4.2.7) (2023-08-24) diff --git a/packages/csv-generate/package.json b/packages/csv-generate/package.json index 39d6435d..7aa4b692 100644 --- a/packages/csv-generate/package.json +++ b/packages/csv-generate/package.json @@ -1,5 +1,5 @@ { - "version": "4.2.7", + "version": "4.2.8", "name": "csv-generate", "description": "CSV and object generation implementing the Node.js `stream.Readable` API", "keywords": [ diff --git a/packages/csv-parse/CHANGELOG.md b/packages/csv-parse/CHANGELOG.md index 0af2d972..9c71d4ed 100644 --- a/packages/csv-parse/CHANGELOG.md +++ b/packages/csv-parse/CHANGELOG.md @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [5.5.0](https://github.com/adaltas/node-csv/compare/csv-parse@5.4.1...csv-parse@5.5.0) (2023-08-25) + + +### Features + +* **csv-parse:** new comment_no_infix option (fix [#325](https://github.com/adaltas/node-csv/issues/325)) ([caca5c3](https://github.com/adaltas/node-csv/commit/caca5c3044541acfc9fe4a7f32167bb1179b6253)) + + +### Bug Fixes + +* **csv-demo-ts-cjs-node16:** upgrade module definition after latest typescript ([87fe919](https://github.com/adaltas/node-csv/commit/87fe91996fb2a8895c252177fca4f0cb59a518f9)) + + + ## [5.4.1](https://github.com/adaltas/node-csv/compare/csv-parse@5.4.0...csv-parse@5.4.1) (2023-08-24) diff --git a/packages/csv-parse/package.json b/packages/csv-parse/package.json index ca738e7f..9723ba10 100644 --- a/packages/csv-parse/package.json +++ b/packages/csv-parse/package.json @@ -1,5 +1,5 @@ { - "version": "5.4.1", + "version": "5.5.0", "name": "csv-parse", "description": "CSV parsing implementing the Node.js `stream.Transform` API", "keywords": [ @@ -66,7 +66,7 @@ "@types/node": "^20.5.6", "coffeelint": "^2.1.0", "coffeescript": "^2.7.0", - "csv-generate": "^4.2.7", + "csv-generate": "^4.2.8", "csv-spectrum": "^1.0.0", "each": "^2.4.0", "eslint": "^8.47.0", @@ -76,7 +76,7 @@ "rollup-plugin-node-builtins": "^2.1.2", "rollup-plugin-node-globals": "^1.4.0", "should": "^13.2.3", - "stream-transform": "^3.2.7", + "stream-transform": "^3.2.8", "ts-node": "^10.9.1", "typescript": "^5.2.2" }, diff --git a/packages/csv-stringify/CHANGELOG.md b/packages/csv-stringify/CHANGELOG.md index 2612e740..a8a8d14f 100644 --- a/packages/csv-stringify/CHANGELOG.md +++ b/packages/csv-stringify/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [6.4.2](https://github.com/adaltas/node-csv/compare/csv-stringify@6.4.1...csv-stringify@6.4.2) (2023-08-25) + + +### Bug Fixes + +* **csv-demo-ts-cjs-node16:** upgrade module definition after latest typescript ([87fe919](https://github.com/adaltas/node-csv/commit/87fe91996fb2a8895c252177fca4f0cb59a518f9)) + + + ## [6.4.1](https://github.com/adaltas/node-csv/compare/csv-stringify@6.4.0...csv-stringify@6.4.1) (2023-08-24) diff --git a/packages/csv-stringify/package.json b/packages/csv-stringify/package.json index 43feb830..205f896a 100644 --- a/packages/csv-stringify/package.json +++ b/packages/csv-stringify/package.json @@ -1,5 +1,5 @@ { - "version": "6.4.1", + "version": "6.4.2", "name": "csv-stringify", "description": "CSV stringifier implementing the Node.js `stream.Transform` API", "keywords": [ @@ -15,7 +15,7 @@ "@types/node": "^20.5.6", "@types/should": "^13.0.0", "coffeescript": "~2.7.0", - "csv-generate": "^4.2.7", + "csv-generate": "^4.2.8", "each": "^2.4.0", "eslint": "^8.47.0", "express": "^4.18.2", diff --git a/packages/csv/CHANGELOG.md b/packages/csv/CHANGELOG.md index e16f0184..aa6b4ebb 100644 --- a/packages/csv/CHANGELOG.md +++ b/packages/csv/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [6.3.3](https://github.com/adaltas/node-csv/compare/csv@6.3.2...csv@6.3.3) (2023-08-25) + + +### Bug Fixes + +* **csv-demo-ts-cjs-node16:** upgrade module definition after latest typescript ([87fe919](https://github.com/adaltas/node-csv/commit/87fe91996fb2a8895c252177fca4f0cb59a518f9)) + + + ## [6.3.2](https://github.com/adaltas/node-csv/compare/csv@6.3.1...csv@6.3.2) (2023-08-24) diff --git a/packages/csv/dist/cjs/index.cjs b/packages/csv/dist/cjs/index.cjs index b4f1a875..2d70e2fe 100644 --- a/packages/csv/dist/cjs/index.cjs +++ b/packages/csv/dist/cjs/index.cjs @@ -534,6 +534,16 @@ const normalize_options$1 = function(opts){ ], options); } } + // Normalize option `comment_no_infix` + if(options.comment_no_infix === undefined || options.comment_no_infix === null || options.comment_no_infix === false){ + options.comment_no_infix = false; + }else if(options.comment_no_infix !== true){ + throw new CsvError$1('CSV_INVALID_OPTION_COMMENT', [ + 'Invalid option comment_no_infix:', + 'value must be a boolean,', + `got ${JSON.stringify(options.comment_no_infix)}` + ], options); + } // Normalize option `delimiter` const delimiter_json = JSON.stringify(options.delimiter); if(!Array.isArray(options.delimiter)) options.delimiter = [options.delimiter]; @@ -895,7 +905,7 @@ const transform$1 = function(original_options = {}) { }, // Central parser implementation parse: function(nextBuf, end, push, close){ - const {bom, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; + const {bom, comment_no_infix, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; let {comment, escape, quote, record_delimiter} = this.options; const {bomSkipped, previousBuf, rawBuffer, escapeIsQuote} = this.state; let buf; @@ -1094,7 +1104,7 @@ const transform$1 = function(original_options = {}) { continue; } const commentCount = comment === null ? 0 : this.__compareBytes(comment, buf, pos, chr); - if(commentCount !== 0){ + if(commentCount !== 0 && (comment_no_infix === false || this.state.field.length === 0)){ this.state.commenting = true; continue; } diff --git a/packages/csv/dist/cjs/sync.cjs b/packages/csv/dist/cjs/sync.cjs index b79b17fb..0e41c642 100644 --- a/packages/csv/dist/cjs/sync.cjs +++ b/packages/csv/dist/cjs/sync.cjs @@ -531,6 +531,16 @@ const normalize_options$1 = function(opts){ ], options); } } + // Normalize option `comment_no_infix` + if(options.comment_no_infix === undefined || options.comment_no_infix === null || options.comment_no_infix === false){ + options.comment_no_infix = false; + }else if(options.comment_no_infix !== true){ + throw new CsvError$1('CSV_INVALID_OPTION_COMMENT', [ + 'Invalid option comment_no_infix:', + 'value must be a boolean,', + `got ${JSON.stringify(options.comment_no_infix)}` + ], options); + } // Normalize option `delimiter` const delimiter_json = JSON.stringify(options.delimiter); if(!Array.isArray(options.delimiter)) options.delimiter = [options.delimiter]; @@ -892,7 +902,7 @@ const transform$1 = function(original_options = {}) { }, // Central parser implementation parse: function(nextBuf, end, push, close){ - const {bom, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; + const {bom, comment_no_infix, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; let {comment, escape, quote, record_delimiter} = this.options; const {bomSkipped, previousBuf, rawBuffer, escapeIsQuote} = this.state; let buf; @@ -1091,7 +1101,7 @@ const transform$1 = function(original_options = {}) { continue; } const commentCount = comment === null ? 0 : this.__compareBytes(comment, buf, pos, chr); - if(commentCount !== 0){ + if(commentCount !== 0 && (comment_no_infix === false || this.state.field.length === 0)){ this.state.commenting = true; continue; } diff --git a/packages/csv/dist/esm/index.js b/packages/csv/dist/esm/index.js index 2567db8c..f2e44001 100644 --- a/packages/csv/dist/esm/index.js +++ b/packages/csv/dist/esm/index.js @@ -5725,6 +5725,16 @@ const normalize_options$1 = function(opts){ ], options); } } + // Normalize option `comment_no_infix` + if(options.comment_no_infix === undefined || options.comment_no_infix === null || options.comment_no_infix === false){ + options.comment_no_infix = false; + }else if(options.comment_no_infix !== true){ + throw new CsvError$1('CSV_INVALID_OPTION_COMMENT', [ + 'Invalid option comment_no_infix:', + 'value must be a boolean,', + `got ${JSON.stringify(options.comment_no_infix)}` + ], options); + } // Normalize option `delimiter` const delimiter_json = JSON.stringify(options.delimiter); if(!Array.isArray(options.delimiter)) options.delimiter = [options.delimiter]; @@ -6086,7 +6096,7 @@ const transform$1 = function(original_options = {}) { }, // Central parser implementation parse: function(nextBuf, end, push, close){ - const {bom, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; + const {bom, comment_no_infix, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; let {comment, escape, quote, record_delimiter} = this.options; const {bomSkipped, previousBuf, rawBuffer, escapeIsQuote} = this.state; let buf; @@ -6285,7 +6295,7 @@ const transform$1 = function(original_options = {}) { continue; } const commentCount = comment === null ? 0 : this.__compareBytes(comment, buf, pos, chr); - if(commentCount !== 0){ + if(commentCount !== 0 && (comment_no_infix === false || this.state.field.length === 0)){ this.state.commenting = true; continue; } diff --git a/packages/csv/dist/esm/sync.js b/packages/csv/dist/esm/sync.js index a9c144be..53de2f0f 100644 --- a/packages/csv/dist/esm/sync.js +++ b/packages/csv/dist/esm/sync.js @@ -5722,6 +5722,16 @@ const normalize_options$1 = function(opts){ ], options); } } + // Normalize option `comment_no_infix` + if(options.comment_no_infix === undefined || options.comment_no_infix === null || options.comment_no_infix === false){ + options.comment_no_infix = false; + }else if(options.comment_no_infix !== true){ + throw new CsvError$1('CSV_INVALID_OPTION_COMMENT', [ + 'Invalid option comment_no_infix:', + 'value must be a boolean,', + `got ${JSON.stringify(options.comment_no_infix)}` + ], options); + } // Normalize option `delimiter` const delimiter_json = JSON.stringify(options.delimiter); if(!Array.isArray(options.delimiter)) options.delimiter = [options.delimiter]; @@ -6083,7 +6093,7 @@ const transform$1 = function(original_options = {}) { }, // Central parser implementation parse: function(nextBuf, end, push, close){ - const {bom, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; + const {bom, comment_no_infix, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; let {comment, escape, quote, record_delimiter} = this.options; const {bomSkipped, previousBuf, rawBuffer, escapeIsQuote} = this.state; let buf; @@ -6282,7 +6292,7 @@ const transform$1 = function(original_options = {}) { continue; } const commentCount = comment === null ? 0 : this.__compareBytes(comment, buf, pos, chr); - if(commentCount !== 0){ + if(commentCount !== 0 && (comment_no_infix === false || this.state.field.length === 0)){ this.state.commenting = true; continue; } diff --git a/packages/csv/dist/iife/index.js b/packages/csv/dist/iife/index.js index 895dd35c..843cfeef 100644 --- a/packages/csv/dist/iife/index.js +++ b/packages/csv/dist/iife/index.js @@ -5728,6 +5728,16 @@ var csv = (function (exports) { ], options); } } + // Normalize option `comment_no_infix` + if(options.comment_no_infix === undefined || options.comment_no_infix === null || options.comment_no_infix === false){ + options.comment_no_infix = false; + }else if(options.comment_no_infix !== true){ + throw new CsvError$1('CSV_INVALID_OPTION_COMMENT', [ + 'Invalid option comment_no_infix:', + 'value must be a boolean,', + `got ${JSON.stringify(options.comment_no_infix)}` + ], options); + } // Normalize option `delimiter` const delimiter_json = JSON.stringify(options.delimiter); if(!Array.isArray(options.delimiter)) options.delimiter = [options.delimiter]; @@ -6089,7 +6099,7 @@ var csv = (function (exports) { }, // Central parser implementation parse: function(nextBuf, end, push, close){ - const {bom, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; + const {bom, comment_no_infix, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; let {comment, escape, quote, record_delimiter} = this.options; const {bomSkipped, previousBuf, rawBuffer, escapeIsQuote} = this.state; let buf; @@ -6288,7 +6298,7 @@ var csv = (function (exports) { continue; } const commentCount = comment === null ? 0 : this.__compareBytes(comment, buf, pos, chr); - if(commentCount !== 0){ + if(commentCount !== 0 && (comment_no_infix === false || this.state.field.length === 0)){ this.state.commenting = true; continue; } diff --git a/packages/csv/dist/iife/sync.js b/packages/csv/dist/iife/sync.js index 71daaf34..d56124a5 100644 --- a/packages/csv/dist/iife/sync.js +++ b/packages/csv/dist/iife/sync.js @@ -5725,6 +5725,16 @@ var csv_sync = (function (exports) { ], options); } } + // Normalize option `comment_no_infix` + if(options.comment_no_infix === undefined || options.comment_no_infix === null || options.comment_no_infix === false){ + options.comment_no_infix = false; + }else if(options.comment_no_infix !== true){ + throw new CsvError$1('CSV_INVALID_OPTION_COMMENT', [ + 'Invalid option comment_no_infix:', + 'value must be a boolean,', + `got ${JSON.stringify(options.comment_no_infix)}` + ], options); + } // Normalize option `delimiter` const delimiter_json = JSON.stringify(options.delimiter); if(!Array.isArray(options.delimiter)) options.delimiter = [options.delimiter]; @@ -6086,7 +6096,7 @@ var csv_sync = (function (exports) { }, // Central parser implementation parse: function(nextBuf, end, push, close){ - const {bom, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; + const {bom, comment_no_infix, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; let {comment, escape, quote, record_delimiter} = this.options; const {bomSkipped, previousBuf, rawBuffer, escapeIsQuote} = this.state; let buf; @@ -6285,7 +6295,7 @@ var csv_sync = (function (exports) { continue; } const commentCount = comment === null ? 0 : this.__compareBytes(comment, buf, pos, chr); - if(commentCount !== 0){ + if(commentCount !== 0 && (comment_no_infix === false || this.state.field.length === 0)){ this.state.commenting = true; continue; } diff --git a/packages/csv/dist/umd/index.js b/packages/csv/dist/umd/index.js index c4ed3fcd..3aacaa24 100644 --- a/packages/csv/dist/umd/index.js +++ b/packages/csv/dist/umd/index.js @@ -5731,6 +5731,16 @@ ], options); } } + // Normalize option `comment_no_infix` + if(options.comment_no_infix === undefined || options.comment_no_infix === null || options.comment_no_infix === false){ + options.comment_no_infix = false; + }else if(options.comment_no_infix !== true){ + throw new CsvError$1('CSV_INVALID_OPTION_COMMENT', [ + 'Invalid option comment_no_infix:', + 'value must be a boolean,', + `got ${JSON.stringify(options.comment_no_infix)}` + ], options); + } // Normalize option `delimiter` const delimiter_json = JSON.stringify(options.delimiter); if(!Array.isArray(options.delimiter)) options.delimiter = [options.delimiter]; @@ -6092,7 +6102,7 @@ }, // Central parser implementation parse: function(nextBuf, end, push, close){ - const {bom, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; + const {bom, comment_no_infix, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; let {comment, escape, quote, record_delimiter} = this.options; const {bomSkipped, previousBuf, rawBuffer, escapeIsQuote} = this.state; let buf; @@ -6291,7 +6301,7 @@ continue; } const commentCount = comment === null ? 0 : this.__compareBytes(comment, buf, pos, chr); - if(commentCount !== 0){ + if(commentCount !== 0 && (comment_no_infix === false || this.state.field.length === 0)){ this.state.commenting = true; continue; } diff --git a/packages/csv/dist/umd/sync.js b/packages/csv/dist/umd/sync.js index e4c6ed87..1e71bc02 100644 --- a/packages/csv/dist/umd/sync.js +++ b/packages/csv/dist/umd/sync.js @@ -5728,6 +5728,16 @@ ], options); } } + // Normalize option `comment_no_infix` + if(options.comment_no_infix === undefined || options.comment_no_infix === null || options.comment_no_infix === false){ + options.comment_no_infix = false; + }else if(options.comment_no_infix !== true){ + throw new CsvError$1('CSV_INVALID_OPTION_COMMENT', [ + 'Invalid option comment_no_infix:', + 'value must be a boolean,', + `got ${JSON.stringify(options.comment_no_infix)}` + ], options); + } // Normalize option `delimiter` const delimiter_json = JSON.stringify(options.delimiter); if(!Array.isArray(options.delimiter)) options.delimiter = [options.delimiter]; @@ -6089,7 +6099,7 @@ }, // Central parser implementation parse: function(nextBuf, end, push, close){ - const {bom, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; + const {bom, comment_no_infix, encoding, from_line, ltrim, max_record_size,raw, relax_quotes, rtrim, skip_empty_lines, to, to_line} = this.options; let {comment, escape, quote, record_delimiter} = this.options; const {bomSkipped, previousBuf, rawBuffer, escapeIsQuote} = this.state; let buf; @@ -6288,7 +6298,7 @@ continue; } const commentCount = comment === null ? 0 : this.__compareBytes(comment, buf, pos, chr); - if(commentCount !== 0){ + if(commentCount !== 0 && (comment_no_infix === false || this.state.field.length === 0)){ this.state.commenting = true; continue; } diff --git a/packages/csv/package.json b/packages/csv/package.json index 9f2dd997..5b8f47de 100644 --- a/packages/csv/package.json +++ b/packages/csv/package.json @@ -1,6 +1,6 @@ { "name": "csv", - "version": "6.3.2", + "version": "6.3.3", "description": "A mature CSV toolset with simple api, full of options and tested against large datasets.", "keywords": [ "node", @@ -21,10 +21,10 @@ "David Worms (https://www.adaltas.com)" ], "dependencies": { - "csv-generate": "^4.2.7", - "csv-parse": "^5.4.1", - "csv-stringify": "^6.4.1", - "stream-transform": "^3.2.7" + "csv-generate": "^4.2.8", + "csv-parse": "^5.5.0", + "csv-stringify": "^6.4.2", + "stream-transform": "^3.2.8" }, "devDependencies": { "@rollup/plugin-eslint": "^9.0.4", diff --git a/packages/stream-transform/CHANGELOG.md b/packages/stream-transform/CHANGELOG.md index c3669edf..eb637911 100644 --- a/packages/stream-transform/CHANGELOG.md +++ b/packages/stream-transform/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.2.8](https://github.com/adaltas/node-csv/compare/stream-transform@3.2.7...stream-transform@3.2.8) (2023-08-25) + + +### Bug Fixes + +* **csv-demo-ts-cjs-node16:** upgrade module definition after latest typescript ([87fe919](https://github.com/adaltas/node-csv/commit/87fe91996fb2a8895c252177fca4f0cb59a518f9)) + + + ## [3.2.7](https://github.com/adaltas/node-csv/compare/stream-transform@3.2.6...stream-transform@3.2.7) (2023-08-24) diff --git a/packages/stream-transform/package.json b/packages/stream-transform/package.json index a9971426..ed614812 100644 --- a/packages/stream-transform/package.json +++ b/packages/stream-transform/package.json @@ -1,5 +1,5 @@ { - "version": "3.2.7", + "version": "3.2.8", "name": "stream-transform", "description": "Object transformations implementing the Node.js `stream.Transform` API", "keywords": [ @@ -15,7 +15,7 @@ "@types/mocha": "^10.0.1", "@types/node": "^20.5.6", "coffeescript": "~2.7.0", - "csv-generate": "^4.2.7", + "csv-generate": "^4.2.8", "each": "^2.4.0", "eslint": "^8.47.0", "mocha": "~10.2.0",