Skip to content

Commit

Permalink
chore(release): publish
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Oct 12, 2022
1 parent 29a0916 commit dbe9cb5
Show file tree
Hide file tree
Showing 18 changed files with 298 additions and 168 deletions.
8 changes: 8 additions & 0 deletions demo/esm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.10](https://github.com/adaltas/node-csv/compare/[email protected]@0.0.10) (2022-10-12)

**Note:** Version bump only for package csv-demo-esm





### [0.0.9](https://github.com/adaltas/node-csv/compare/[email protected]@0.0.9) (2022-07-10)

**Note:** Version bump only for package csv-demo-esm
Expand Down
6 changes: 3 additions & 3 deletions demo/esm/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "csv-demo-esm",
"version": "0.0.9",
"version": "0.0.10",
"main": "index.js",
"license": "MIT",
"type": "module",
"private": true,
"dependencies": {
"csv": "^6.2.0",
"csv-parse": "^5.3.0"
"csv": "^6.2.1",
"csv-parse": "^5.3.1"
},
"devDependencies": {
"coffeescript": "^2.7.0",
Expand Down
9 changes: 9 additions & 0 deletions demo/issues-esm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.0.4](https://github.com/adaltas/node-csv/compare/[email protected]@0.0.4) (2022-10-12)


### Bug Fixes

* **csv-parse:** record_delimiter and non default encoding (fix [#365](https://github.com/adaltas/node-csv/issues/365)) ([16fdb2d](https://github.com/adaltas/node-csv/commit/16fdb2dd2c3221d00568f28bed44106ffc0d49ef))



### [0.0.3](https://github.com/adaltas/node-csv/compare/[email protected]@0.0.3) (2022-06-29)

**Note:** Version bump only for package csv-issues-esm
Expand Down
2 changes: 1 addition & 1 deletion demo/issues-esm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "csv-issues-esm",
"version": "0.0.3",
"version": "0.0.4",
"main": "index.js",
"license": "MIT",
"type": "module",
Expand Down
15 changes: 15 additions & 0 deletions demo/ts-module-node16/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 0.2.0 (2022-10-12)


### Features

* **csv-demo-ts-module-node16:** dynamic import ([8ed0e18](https://github.com/adaltas/node-csv/commit/8ed0e186c9422ba5238b9e9c4adb9e94f8be4332))
* ts module Node16 and type declaration to exports field ([#341](https://github.com/adaltas/node-csv/issues/341)) ([4b0283d](https://github.com/adaltas/node-csv/commit/4b0283d17b7fa46daa1f87380759ba72c71ec79b))


### Bug Fixes

* **csv-demo-ts-module-node16:** package renaming ([f66e6ea](https://github.com/adaltas/node-csv/commit/f66e6ea9b8c107499b5da5f8ea212426a4498305))



## 0.1.0 (2022-07-10)


Expand Down
2 changes: 1 addition & 1 deletion demo/ts-module-node16/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "csv-demo-ts-module-node16",
"version": "0.1.0",
"version": "0.2.0",
"main": "index.js",
"license": "MIT",
"type": "module",
Expand Down
10 changes: 10 additions & 0 deletions packages/csv-parse/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

### [5.3.1](https://github.com/adaltas/node-csv/compare/[email protected]@5.3.1) (2022-10-12)


### Bug Fixes

* **csv-parse:** build from previus commit ([29a0916](https://github.com/adaltas/node-csv/commit/29a0916026429d648e8c515ada4a452036e0736d))
* **csv-parse:** record_delimiter and non default encoding (fix [#365](https://github.com/adaltas/node-csv/issues/365)) ([16fdb2d](https://github.com/adaltas/node-csv/commit/16fdb2dd2c3221d00568f28bed44106ffc0d49ef))



## [5.3.0](https://github.com/adaltas/node-csv/compare/[email protected]@5.3.0) (2022-07-10)


Expand Down
2 changes: 1 addition & 1 deletion packages/csv-parse/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.3.0",
"version": "5.3.1",
"name": "csv-parse",
"description": "CSV parsing implementing the Node.js `stream.Transform` API",
"keywords": [
Expand Down
8 changes: 8 additions & 0 deletions packages/csv/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

### [6.2.1](https://github.com/adaltas/node-csv/compare/[email protected]@6.2.1) (2022-10-12)

**Note:** Version bump only for package csv





## [6.2.0](https://github.com/adaltas/node-csv/compare/[email protected]@6.2.0) (2022-07-10)


Expand Down
50 changes: 30 additions & 20 deletions packages/csv/dist/cjs/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ const init_state = function(options){
record: [],
recordHasError: false,
record_length: 0,
recordDelimiterMaxLength: options.record_delimiter.length === 0 ? 2 : Math.max(...options.record_delimiter.map((v) => v.length)),
recordDelimiterMaxLength: options.record_delimiter.length === 0 ? 0 : Math.max(...options.record_delimiter.map((v) => v.length)),
trimChars: [Buffer.from(' ', options.encoding)[0], Buffer.from('\t', options.encoding)[0]],
wasQuoting: false,
wasRowDelimiter: false,
Expand Down Expand Up @@ -881,15 +881,21 @@ const transform$1 = function(original_options = {}) {
state: init_state(options),
__needMoreData: function(i, bufLen, end){
if(end) return false;
const {quote} = this.options;
const {encoding, escape, quote} = this.options;
const {quoting, needMoreDataSize, recordDelimiterMaxLength} = this.state;
const numOfCharLeft = bufLen - i - 1;
const requiredLength = Math.max(
needMoreDataSize,
// Skip if the remaining buffer smaller than record delimiter
recordDelimiterMaxLength,
// Skip if the remaining buffer can be record delimiter following the closing quote
// 1 is for quote.length
// If "record_delimiter" is yet to be discovered:
// 1. It is equals to `[]` and "recordDelimiterMaxLength" equals `0`
// 2. We set the length to windows line ending in the current encoding
// Note, that encoding is known from user or bom discovery at that point
// recordDelimiterMaxLength,
recordDelimiterMaxLength === 0 ? Buffer.from('\r\n', encoding).length : recordDelimiterMaxLength,
// Skip if remaining buffer can be an escaped quote
quoting ? ((escape === null ? 0 : escape.length) + quote.length) : 0,
// Skip if remaining buffer can be record delimiter following the closing quote
quoting ? (quote.length + recordDelimiterMaxLength) : 0,
);
return numOfCharLeft < requiredLength;
Expand Down Expand Up @@ -1485,22 +1491,26 @@ const transform$1 = function(original_options = {}) {
return true;
},
__autoDiscoverRecordDelimiter: function(buf, pos){
const {encoding} = this.options;
const chr = buf[pos];
if(chr === cr){
if(buf[pos+1] === nl){
this.options.record_delimiter.push(Buffer.from('\r\n', encoding));
this.state.recordDelimiterMaxLength = 2;
return 2;
}else {
this.options.record_delimiter.push(Buffer.from('\r', encoding));
this.state.recordDelimiterMaxLength = 1;
return 1;
const { encoding } = this.options;
// Note, we don't need to cache this information in state,
// It is only called on the first line until we find out a suitable
// record delimiter.
const rds = [
// Important, the windows line ending must be before mac os 9
Buffer.from('\r\n', encoding),
Buffer.from('\n', encoding),
Buffer.from('\r', encoding),
];
loop: for(let i = 0; i < rds.length; i++){
const l = rds[i].length;
for(let j = 0; j < l; j++){
if(rds[i][j] !== buf[pos + j]){
continue loop;
}
}
}else if(chr === nl){
this.options.record_delimiter.push(Buffer.from('\n', encoding));
this.state.recordDelimiterMaxLength = 1;
return 1;
this.options.record_delimiter.push(rds[i]);
this.state.recordDelimiterMaxLength = rds[i].length;
return rds[i].length;
}
return 0;
},
Expand Down
50 changes: 30 additions & 20 deletions packages/csv/dist/cjs/sync.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ const init_state = function(options){
record: [],
recordHasError: false,
record_length: 0,
recordDelimiterMaxLength: options.record_delimiter.length === 0 ? 2 : Math.max(...options.record_delimiter.map((v) => v.length)),
recordDelimiterMaxLength: options.record_delimiter.length === 0 ? 0 : Math.max(...options.record_delimiter.map((v) => v.length)),
trimChars: [Buffer.from(' ', options.encoding)[0], Buffer.from('\t', options.encoding)[0]],
wasQuoting: false,
wasRowDelimiter: false,
Expand Down Expand Up @@ -878,15 +878,21 @@ const transform$1 = function(original_options = {}) {
state: init_state(options),
__needMoreData: function(i, bufLen, end){
if(end) return false;
const {quote} = this.options;
const {encoding, escape, quote} = this.options;
const {quoting, needMoreDataSize, recordDelimiterMaxLength} = this.state;
const numOfCharLeft = bufLen - i - 1;
const requiredLength = Math.max(
needMoreDataSize,
// Skip if the remaining buffer smaller than record delimiter
recordDelimiterMaxLength,
// Skip if the remaining buffer can be record delimiter following the closing quote
// 1 is for quote.length
// If "record_delimiter" is yet to be discovered:
// 1. It is equals to `[]` and "recordDelimiterMaxLength" equals `0`
// 2. We set the length to windows line ending in the current encoding
// Note, that encoding is known from user or bom discovery at that point
// recordDelimiterMaxLength,
recordDelimiterMaxLength === 0 ? Buffer.from('\r\n', encoding).length : recordDelimiterMaxLength,
// Skip if remaining buffer can be an escaped quote
quoting ? ((escape === null ? 0 : escape.length) + quote.length) : 0,
// Skip if remaining buffer can be record delimiter following the closing quote
quoting ? (quote.length + recordDelimiterMaxLength) : 0,
);
return numOfCharLeft < requiredLength;
Expand Down Expand Up @@ -1482,22 +1488,26 @@ const transform$1 = function(original_options = {}) {
return true;
},
__autoDiscoverRecordDelimiter: function(buf, pos){
const {encoding} = this.options;
const chr = buf[pos];
if(chr === cr){
if(buf[pos+1] === nl){
this.options.record_delimiter.push(Buffer.from('\r\n', encoding));
this.state.recordDelimiterMaxLength = 2;
return 2;
}else {
this.options.record_delimiter.push(Buffer.from('\r', encoding));
this.state.recordDelimiterMaxLength = 1;
return 1;
const { encoding } = this.options;
// Note, we don't need to cache this information in state,
// It is only called on the first line until we find out a suitable
// record delimiter.
const rds = [
// Important, the windows line ending must be before mac os 9
Buffer.from('\r\n', encoding),
Buffer.from('\n', encoding),
Buffer.from('\r', encoding),
];
loop: for(let i = 0; i < rds.length; i++){
const l = rds[i].length;
for(let j = 0; j < l; j++){
if(rds[i][j] !== buf[pos + j]){
continue loop;
}
}
}else if(chr === nl){
this.options.record_delimiter.push(Buffer.from('\n', encoding));
this.state.recordDelimiterMaxLength = 1;
return 1;
this.options.record_delimiter.push(rds[i]);
this.state.recordDelimiterMaxLength = rds[i].length;
return rds[i].length;
}
return 0;
},
Expand Down
50 changes: 30 additions & 20 deletions packages/csv/dist/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5536,7 +5536,7 @@ const init_state = function(options){
record: [],
recordHasError: false,
record_length: 0,
recordDelimiterMaxLength: options.record_delimiter.length === 0 ? 2 : Math.max(...options.record_delimiter.map((v) => v.length)),
recordDelimiterMaxLength: options.record_delimiter.length === 0 ? 0 : Math.max(...options.record_delimiter.map((v) => v.length)),
trimChars: [Buffer.from(' ', options.encoding)[0], Buffer.from('\t', options.encoding)[0]],
wasQuoting: false,
wasRowDelimiter: false,
Expand Down Expand Up @@ -6001,15 +6001,21 @@ const transform$1 = function(original_options = {}) {
state: init_state(options),
__needMoreData: function(i, bufLen, end){
if(end) return false;
const {quote} = this.options;
const {encoding, escape, quote} = this.options;
const {quoting, needMoreDataSize, recordDelimiterMaxLength} = this.state;
const numOfCharLeft = bufLen - i - 1;
const requiredLength = Math.max(
needMoreDataSize,
// Skip if the remaining buffer smaller than record delimiter
recordDelimiterMaxLength,
// Skip if the remaining buffer can be record delimiter following the closing quote
// 1 is for quote.length
// If "record_delimiter" is yet to be discovered:
// 1. It is equals to `[]` and "recordDelimiterMaxLength" equals `0`
// 2. We set the length to windows line ending in the current encoding
// Note, that encoding is known from user or bom discovery at that point
// recordDelimiterMaxLength,
recordDelimiterMaxLength === 0 ? Buffer.from('\r\n', encoding).length : recordDelimiterMaxLength,
// Skip if remaining buffer can be an escaped quote
quoting ? ((escape === null ? 0 : escape.length) + quote.length) : 0,
// Skip if remaining buffer can be record delimiter following the closing quote
quoting ? (quote.length + recordDelimiterMaxLength) : 0,
);
return numOfCharLeft < requiredLength;
Expand Down Expand Up @@ -6605,22 +6611,26 @@ const transform$1 = function(original_options = {}) {
return true;
},
__autoDiscoverRecordDelimiter: function(buf, pos){
const {encoding} = this.options;
const chr = buf[pos];
if(chr === cr){
if(buf[pos+1] === nl){
this.options.record_delimiter.push(Buffer.from('\r\n', encoding));
this.state.recordDelimiterMaxLength = 2;
return 2;
}else {
this.options.record_delimiter.push(Buffer.from('\r', encoding));
this.state.recordDelimiterMaxLength = 1;
return 1;
const { encoding } = this.options;
// Note, we don't need to cache this information in state,
// It is only called on the first line until we find out a suitable
// record delimiter.
const rds = [
// Important, the windows line ending must be before mac os 9
Buffer.from('\r\n', encoding),
Buffer.from('\n', encoding),
Buffer.from('\r', encoding),
];
loop: for(let i = 0; i < rds.length; i++){
const l = rds[i].length;
for(let j = 0; j < l; j++){
if(rds[i][j] !== buf[pos + j]){
continue loop;
}
}
}else if(chr === nl){
this.options.record_delimiter.push(Buffer.from('\n', encoding));
this.state.recordDelimiterMaxLength = 1;
return 1;
this.options.record_delimiter.push(rds[i]);
this.state.recordDelimiterMaxLength = rds[i].length;
return rds[i].length;
}
return 0;
},
Expand Down
Loading

0 comments on commit dbe9cb5

Please sign in to comment.