Merge pull request #195 from docker/dependabot/npm_and_yarn/csv-parse-5.0.4

Bump csv-parse from 4.16.3 to 5.0.4
This commit is contained in:
CrazyMax 2022-04-25 13:39:06 +02:00 committed by GitHub
commit 535130561a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 33 additions and 33 deletions

20
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -6,5 +6,8 @@ module.exports = {
transform: { transform: {
'^.+\\.ts$': 'ts-jest' '^.+\\.ts$': 'ts-jest'
}, },
moduleNameMapper: {
'^csv-parse/sync': '<rootDir>/node_modules/csv-parse/dist/cjs/sync.cjs'
},
verbose: true verbose: true
}; };

View File

@ -32,7 +32,7 @@
"@actions/core": "^1.6.0", "@actions/core": "^1.6.0",
"@actions/github": "^5.0.1", "@actions/github": "^5.0.1",
"@renovate/pep440": "^1.0.0", "@renovate/pep440": "^1.0.0",
"csv-parse": "^4.16.3", "csv-parse": "^5.0.4",
"handlebars": "^4.7.7", "handlebars": "^4.7.7",
"moment": "^2.29.3", "moment": "^2.29.3",
"semver": "^7.3.7" "semver": "^7.3.7"

View File

@ -1,4 +1,4 @@
import csvparse from 'csv-parse/lib/sync'; import {parse} from 'csv-parse/sync';
import * as core from '@actions/core'; import * as core from '@actions/core';
import {issueCommand} from '@actions/core/lib/command'; import {issueCommand} from '@actions/core/lib/command';
import * as fs from 'fs'; import * as fs from 'fs';
@ -46,21 +46,23 @@ export function getInputList(name: string, ignoreComma?: boolean): string[] {
return res; return res;
} }
for (const output of csvparse(items, { const records = parse(items, {
columns: false, columns: false,
relax: true, relaxQuotes: true,
comment: '#', comment: '#',
relaxColumnCount: true, relaxColumnCount: true,
skipLinesWithEmptyValues: true skipEmptyLines: true
}) as Array<string[]>) { });
if (output.length == 1) {
res.push(output[0]); for (const record of records as Array<string[]>) {
if (record.length == 1) {
res.push(record[0]);
continue; continue;
} else if (!ignoreComma) { } else if (!ignoreComma) {
res.push(...output); res.push(...record);
continue; continue;
} }
res.push(output.join(',')); res.push(record.join(','));
} }
return res.filter(item => item).map(pat => pat.trim()); return res.filter(item => item).map(pat => pat.trim());

View File

@ -1,5 +1,5 @@
import {parse} from 'csv-parse/sync';
import * as core from '@actions/core'; import * as core from '@actions/core';
import csvparse from 'csv-parse/lib/sync';
export interface Flavor { export interface Flavor {
latest: string; latest: string;
@ -19,9 +19,9 @@ export function Transform(inputs: string[]): Flavor {
}; };
for (const input of inputs) { for (const input of inputs) {
const fields = csvparse(input, { const fields = parse(input, {
relaxColumnCount: true, relaxColumnCount: true,
skipLinesWithEmptyValues: true skipEmptyLines: true
})[0]; })[0];
let onlatestfor = ''; let onlatestfor = '';
for (const field of fields) { for (const field of fields) {

View File

@ -1,4 +1,4 @@
import csvparse from 'csv-parse/lib/sync'; import {parse} from 'csv-parse/sync';
import * as core from '@actions/core'; import * as core from '@actions/core';
export enum Type { export enum Type {
@ -86,9 +86,9 @@ export function Transform(inputs: string[]): Tag[] {
} }
export function Parse(s: string): Tag { export function Parse(s: string): Tag {
const fields = csvparse(s, { const fields = parse(s, {
relaxColumnCount: true, relaxColumnCount: true,
skipLinesWithEmptyValues: true skipEmptyLines: true
})[0]; })[0];
const tag = new Tag(); const tag = new Tag();

View File

@ -1604,16 +1604,11 @@ cssstyle@^2.3.0:
dependencies: dependencies:
cssom "~0.3.6" cssom "~0.3.6"
csv-parse@*: csv-parse@*, csv-parse@^5.0.4:
version "5.0.4" version "5.0.4"
resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-5.0.4.tgz#97e5e654413bcf95f2714ce09bcb2be6de0eb8e3" resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-5.0.4.tgz#97e5e654413bcf95f2714ce09bcb2be6de0eb8e3"
integrity sha512-5AIdl8l6n3iYQYxan5djB5eKDa+vBnhfWZtRpJTcrETWfVLYN0WSj3L9RwvgYt+psoO77juUr8TG8qpfGZifVQ== integrity sha512-5AIdl8l6n3iYQYxan5djB5eKDa+vBnhfWZtRpJTcrETWfVLYN0WSj3L9RwvgYt+psoO77juUr8TG8qpfGZifVQ==
csv-parse@^4.16.3:
version "4.16.3"
resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-4.16.3.tgz#7ca624d517212ebc520a36873c3478fa66efbaf7"
integrity sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==
data-urls@^2.0.0: data-urls@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b"