Skip to content

Commit

Permalink
speed up parser a bit, update dependencies, rebuild (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
Simek authored Nov 23, 2024
1 parent 09576a8 commit 2fc6f6c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
"semver": "^7.6.3"
},
"devDependencies": {
"@vercel/ncc": "^0.38.2",
"@vercel/ncc": "^0.38.3",
"@yarnpkg/lockfile": "^1.1.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-n": "^17.12.0",
"eslint-plugin-n": "^17.14.0",
"eslint-plugin-prettier": "^5.2.1",
"prettier": "^3.3.3",
"svgo": "^3.3.2",
Expand Down
5 changes: 2 additions & 3 deletions src/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ export const parseLock = content => {

const cleanedLines = lines.slice(metadata.skipLines);
const maxIndex = cleanedLines.length - 1;
const entryConstructor = metadata.version === 1 ? constructClassicEntry : constructBerryEntry;

const entryChunks = [];
cleanedLines.reduce((previousValue, currentValue, currentIndex) => {
Expand All @@ -180,9 +181,7 @@ export const parseLock = content => {

const result = entryChunks
.filter(entryLines => entryLines.length >= 4)
.map(entryLines =>
metadata.version === 1 ? constructClassicEntry(entryLines) : constructBerryEntry(entryLines)
)
.map(entryConstructor)
.filter(Boolean);

// Retain the official parser result structure for a while
Expand Down
30 changes: 15 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
resolved "https://registry.yarnpkg.com/@actions/io/-/io-1.1.3.tgz#4cdb6254da7962b07473ff5c335f3da485d94d71"
integrity sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==

"@eslint-community/eslint-utils@^4.1.2", "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0":
version "4.4.0"
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59"
integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==
"@eslint-community/eslint-utils@^4.1.2", "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.1":
version "4.4.1"
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz#d1145bf2c20132d6400495d6df4bf59362fd9d56"
integrity sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==
dependencies:
eslint-visitor-keys "^3.3.0"
eslint-visitor-keys "^3.4.3"

"@eslint-community/regexpp@^4.11.0", "@eslint-community/regexpp@^4.6.1":
version "4.12.1"
Expand Down Expand Up @@ -229,10 +229,10 @@
resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406"
integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==

"@vercel/ncc@^0.38.2":
version "0.38.2"
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.38.2.tgz#d35c3a74c671699ccf316f74bf0ecab6b60e312b"
integrity sha512-3yel3jaxUg9pHBv4+KeC9qlbdZPug+UMtUOlhvpDYCMSgcNSrS2Hv1LoqMsOV7hf2lYscx+BESfJOIla1WsmMQ==
"@vercel/ncc@^0.38.3":
version "0.38.3"
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.38.3.tgz#5475eeee3ac0f1a439f237596911525a490a88b5"
integrity sha512-rnK6hJBS6mwc+Bkab+PGPs9OiS0i/3kdTO+CkI8V0/VrW3vmz7O2Pxjw/owOlmo6PKEIxRSeZKv/kuL9itnpYA==

"@yarnpkg/lockfile@^1.1.0":
version "1.1.0"
Expand Down Expand Up @@ -492,12 +492,12 @@ eslint-plugin-es-x@^7.8.0:
"@eslint-community/regexpp" "^4.11.0"
eslint-compat-utils "^0.5.1"

eslint-plugin-n@^17.12.0:
version "17.12.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-n/-/eslint-plugin-n-17.12.0.tgz#a6518a2806a21801ac4d532d23c1ac7f8d49ee49"
integrity sha512-zNAtz/erDn0v78bIY3MASSQlyaarV4IOTvP5ldHsqblRFrXriikB6ghkDTkHjUad+nMRrIbOy9euod2azjRfBg==
eslint-plugin-n@^17.14.0:
version "17.14.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-n/-/eslint-plugin-n-17.14.0.tgz#162a7c17a7ce7e3834af537bca68ab8b6aa26edc"
integrity sha512-maxPLMEA0rPmRpoOlxEclKng4UpDe+N5BJS4t24I3UKnN109Qcivnfs37KMy84G0af3bxjog5lKctP5ObsvcTA==
dependencies:
"@eslint-community/eslint-utils" "^4.4.0"
"@eslint-community/eslint-utils" "^4.4.1"
enhanced-resolve "^5.17.1"
eslint-plugin-es-x "^7.8.0"
get-tsconfig "^4.8.1"
Expand All @@ -522,7 +522,7 @@ eslint-scope@^7.2.2:
esrecurse "^4.3.0"
estraverse "^5.2.0"

eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3:
eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3:
version "3.4.3"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800"
integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==
Expand Down

0 comments on commit 2fc6f6c

Please sign in to comment.