From 682140a802c7c29a37af3a2dece81f337c4ebdc6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Mar 2021 19:11:42 +0000 Subject: [PATCH 1/2] Bump csv-parse from 4.15.0 to 4.15.3 Bumps [csv-parse](https://github.com/wdavidw/node-csv-parse) from 4.15.0 to 4.15.3. - [Release notes](https://github.com/wdavidw/node-csv-parse/releases) - [Changelog](https://github.com/adaltas/node-csv-parse/blob/master/CHANGELOG.md) - [Commits](https://github.com/wdavidw/node-csv-parse/compare/v4.15.0...v4.15.3) Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index fc0126f..5cba50c 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "dependencies": { "@actions/core": "^1.2.6", "@actions/exec": "^1.0.4", - "csv-parse": "^4.15.0", + "csv-parse": "^4.15.3", "semver": "^7.3.4" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 039e655..930af96 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1114,10 +1114,10 @@ cssstyle@^2.2.0: dependencies: cssom "~0.3.6" -csv-parse@^4.15.0: - version "4.15.0" - resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-4.15.0.tgz#d86d447e88d5f9a539e8768874f89a8d86d8fd78" - integrity sha512-y2wGeU/ybvUlyw6F+eanM6lxxE4JthCuHuaoTgPXdw6ImmfYXqtP0nrCLqd6Ew/a0FgPEz36y5HznI0W5oJ+cg== +csv-parse@^4.15.3: + version "4.15.3" + resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-4.15.3.tgz#8a62759617a920c328cb31c351b05053b8f92b10" + integrity sha512-jlTqDvLdHnYMSr08ynNfk4IAUSJgJjTKy2U5CQBSu4cN9vQOJonLVZP4Qo4gKKrIgIQ5dr07UwOJdi+lRqT12w== dashdash@^1.12.0: version "1.14.1" From 1f3247e079e3bbbb353df59c724c21e5d06eb23f Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Thu, 18 Mar 2021 20:21:57 +0100 Subject: [PATCH 2/2] Update generated content --- dist/index.js | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/dist/index.js b/dist/index.js index 5f14a28..1978673 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4856,7 +4856,7 @@ class Parser extends Transform { recordDelimiterMaxLength: options.record_delimiter.length === 0 ? 2 : Math.max(...options.record_delimiter.map( (v) => v.length)), trimChars: [Buffer.from(' ', options.encoding)[0], Buffer.from('\t', options.encoding)[0]], wasQuoting: false, - wasRecordDelimiter: false + wasRowDelimiter: false } } // Implementation of `Transform._transform` @@ -4929,12 +4929,12 @@ class Parser extends Transform { if(this.__needMoreData(pos, bufLen, end)){ break } - if(this.state.wasRecordDelimiter === true){ + if(this.state.wasRowDelimiter === true){ this.info.lines++ if(info === true && this.state.record.length === 0 && this.state.field.length === 0 && this.state.wasQuoting === false){ this.state.info = Object.assign({}, this.info) } - this.state.wasRecordDelimiter = false + this.state.wasRowDelimiter = false } if(to_line !== -1 && this.info.lines > to_line){ this.state.stop = true @@ -4952,8 +4952,8 @@ class Parser extends Transform { if(raw === true){ rawBuffer.append(chr) } - if((chr === cr || chr === nl) && this.state.wasRecordDelimiter === false ){ - this.state.wasRecordDelimiter = true + if((chr === cr || chr === nl) && this.state.wasRowDelimiter === false ){ + this.state.wasRowDelimiter = true } // Previous char was a valid escape char // treat the current char as a regular char @@ -5041,25 +5041,24 @@ class Parser extends Transform { this.info.comment_lines++ // Skip full comment line }else{ + // Activate records emition if above from_line + if(this.state.enabled === false && this.info.lines + (this.state.wasRowDelimiter === true ? 1: 0) >= from_line){ + this.state.enabled = true + this.__resetField() + this.__resetRecord() + pos += recordDelimiterLength - 1 + continue + } // Skip if line is empty and skip_empty_lines activated if(skip_empty_lines === true && this.state.wasQuoting === false && this.state.record.length === 0 && this.state.field.length === 0){ this.info.empty_lines++ pos += recordDelimiterLength - 1 continue } - // Activate records emition if above from_line - if(this.state.enabled === false && this.info.lines + (this.state.wasRecordDelimiter === true ? 1: 0 ) >= from_line){ - this.state.enabled = true - this.__resetField() - this.__resetRecord() - pos += recordDelimiterLength - 1 - continue - }else{ - const errField = this.__onField() - if(errField !== undefined) return errField - const errRecord = this.__onRecord() - if(errRecord !== undefined) return errRecord - } + const errField = this.__onField() + if(errField !== undefined) return errField + const errRecord = this.__onRecord() + if(errRecord !== undefined) return errRecord if(to !== -1 && this.info.records >= to){ this.state.stop = true this.push(null) @@ -5134,7 +5133,7 @@ class Parser extends Transform { if(errField !== undefined) return errField const errRecord = this.__onRecord() if(errRecord !== undefined) return errRecord - }else if(this.state.wasRecordDelimiter === true){ + }else if(this.state.wasRowDelimiter === true){ this.info.empty_lines++ }else if(this.state.commenting === true){ this.info.comment_lines++ @@ -5143,9 +5142,9 @@ class Parser extends Transform { }else{ this.state.previousBuf = buf.slice(pos) } - if(this.state.wasRecordDelimiter === true){ + if(this.state.wasRowDelimiter === true){ this.info.lines++ - this.state.wasRecordDelimiter = false + this.state.wasRowDelimiter = false } } __onRecord(){