diff --git a/jest.config.js b/jest.config.js index 095740e..9269a67 100644 --- a/jest.config.js +++ b/jest.config.js @@ -3,5 +3,8 @@ module.exports = { transform: { '^.+\\.(ts|tsx)$': 'ts-jest', }, + moduleNameMapper: { + 'csv-parse': '/node_modules/csv-parse/dist/cjs/sync.cjs', + }, moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'], }; diff --git a/package.json b/package.json index 0e748ba..25ca6be 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,8 @@ }, "dependencies": { "await-lock": "^2.0.1", - "csv-parse": "^4.15.3", + "buffer": "^6.0.3", + "csv-parse": "^5.3.5", "expression-eval": "^5.0.0", "picomatch": "^2.2.3" }, diff --git a/src/persist/helper.ts b/src/persist/helper.ts index 403c3bd..141b886 100644 --- a/src/persist/helper.ts +++ b/src/persist/helper.ts @@ -1,5 +1,5 @@ import { Model } from '../model'; -import parse from 'csv-parse/lib/sync'; +import { parse } from 'csv-parse/sync'; export class Helper { public static loadPolicyLine(line: string, model: Model): void { diff --git a/yarn.lock b/yarn.lock index e6cd7b9..61512e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1579,6 +1579,11 @@ balanced-match@^1.0.0: resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + base@^0.11.1: version "0.11.2" resolved "https://registry.npmjs.org/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" @@ -1692,6 +1697,14 @@ buffer-from@1.x, buffer-from@^1.0.0: resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + builtin-modules@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -2255,10 +2268,10 @@ cssstyle@^2.3.0: dependencies: cssom "~0.3.6" -csv-parse@^4.15.3: - version "4.15.4" - resolved "https://registry.npmjs.org/csv-parse/-/csv-parse-4.15.4.tgz#ad1ec62aaf71a642982dfcb81f1848184d691db5" - integrity sha512-OdBbFc0yZhOm17lSxqkirrHlFFVpKRT0wp4DAGoJelsP3LbGzV9LNr7XmM/lrr0uGkCtaqac9UhP8PDHXOAbMg== +csv-parse@^5.3.5: + version "5.3.5" + resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-5.3.5.tgz#9924bbba9f7056122f06b7af18edc1a7f022ce99" + integrity sha512-8O5KTIRtwmtD3+EVfW6BCgbwZqJbhTYsQZry12F1TP5RUp0sD9tp1UnCWic3n0mLOhzeocYaCZNYxOGSg3dmmQ== cz-conventional-changelog@3.2.0: version "3.2.0" @@ -3620,6 +3633,11 @@ iconv-lite@^0.6.2: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + ignore-walk@^3.0.3: version "3.0.3" resolved "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz#017e2447184bfeade7c238e4aefdd1e8f95b1e37"