Skip to content

Commit 5595f90

Browse files
authored
Merge pull request #57 from docker/dependabot/npm_and_yarn/csv-parse-5.0.4
Bump csv-parse from 4.16.3 to 5.0.4
2 parents cd0aebd + 407697c commit 5595f90

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

dist/index.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jest.config.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
module.exports = {
22
clearMocks: true,
33
moduleFileExtensions: ['js', 'ts'],
4-
setupFiles: ["dotenv/config"],
4+
setupFiles: ['dotenv/config'],
55
testMatch: ['**/*.test.ts'],
66
transform: {
77
'^.+\\.ts$': 'ts-jest'
88
},
9+
moduleNameMapper: {
10+
'^csv-parse/sync': '<rootDir>/node_modules/csv-parse/dist/cjs/sync.cjs'
11+
},
912
verbose: true
10-
}
13+
};

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"dependencies": {
3131
"@actions/core": "^1.6.0",
3232
"@actions/exec": "^1.1.1",
33-
"csv-parse": "^4.16.3",
33+
"csv-parse": "^5.0.4",
3434
"semver": "^7.3.7",
3535
"tmp": "^0.2.1"
3636
},

src/context.ts

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import csvparse from 'csv-parse/lib/sync';
1+
import {parse} from 'csv-parse/sync';
22
import * as fs from 'fs';
33
import * as os from 'os';
44
import * as path from 'path';
@@ -96,19 +96,21 @@ export function getInputList(name: string, ignoreComma?: boolean): string[] {
9696
return res;
9797
}
9898

99-
for (const output of csvparse(items, {
99+
const records = parse(items, {
100100
columns: false,
101101
relaxColumnCount: true,
102-
skipLinesWithEmptyValues: true
103-
}) as Array<string[]>) {
104-
if (output.length == 1) {
105-
res.push(output[0]);
102+
skipEmptyLines: true
103+
});
104+
105+
for (const record of records as Array<string[]>) {
106+
if (record.length == 1) {
107+
res.push(record[0]);
106108
continue;
107109
} else if (!ignoreComma) {
108-
res.push(...output);
110+
res.push(...record);
109111
continue;
110112
}
111-
res.push(output.join(','));
113+
res.push(record.join(','));
112114
}
113115

114116
return res.filter(item => item).map(pat => pat.trim());

yarn.lock

+1-6
Original file line numberDiff line numberDiff line change
@@ -1444,16 +1444,11 @@ cssstyle@^2.3.0:
14441444
dependencies:
14451445
cssom "~0.3.6"
14461446

1447-
csv-parse@*:
1447+
csv-parse@*, csv-parse@^5.0.4:
14481448
version "5.0.4"
14491449
resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-5.0.4.tgz#97e5e654413bcf95f2714ce09bcb2be6de0eb8e3"
14501450
integrity sha512-5AIdl8l6n3iYQYxan5djB5eKDa+vBnhfWZtRpJTcrETWfVLYN0WSj3L9RwvgYt+psoO77juUr8TG8qpfGZifVQ==
14511451

1452-
csv-parse@^4.16.3:
1453-
version "4.16.3"
1454-
resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-4.16.3.tgz#7ca624d517212ebc520a36873c3478fa66efbaf7"
1455-
integrity sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==
1456-
14571452
data-urls@^2.0.0:
14581453
version "2.0.0"
14591454
resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b"

0 commit comments

Comments
 (0)