File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed
packages/cli/src/utils/ecosystem Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -32,20 +32,11 @@ import browserslist from 'browserslist'
3232import semver from 'semver'
3333
3434const require = createRequire ( import . meta. url )
35-
36- // Lazy-load Bun lockfile parser only when needed.
37- let parseBunLockb : ( ( buf : Uint8Array | ArrayBuffer ) => string ) | undefined
38-
39- function getParseBunLockb ( ) {
40- if ( ! parseBunLockb ) {
41- // Type definition is incorrect - exports object with parse method, not namespace.
42- const parser = require ( '@socketregistry/hyrious__bun.lockb/index.cjs' ) as {
43- parse : ( buf : Uint8Array | ArrayBuffer ) => string
44- }
45- parseBunLockb = parser . parse
35+ // Type definition is incorrect - exports object with parse method, not namespace.
36+ const { parse : parseBunLockb } =
37+ require ( '@socketregistry/hyrious__bun.lockb/index.cjs' ) as {
38+ parse : ( buf : Uint8Array | ArrayBuffer ) => string
4639 }
47- return parseBunLockb
48- }
4940
5041import { whichBin } from '@socketsecurity/lib/bin'
5142import {
@@ -220,7 +211,7 @@ const readLockFileByAgent: Map<Agent, ReadLockFile> = (() => {
220211 const lockBuffer = await binaryReader ( lockPath )
221212 if ( lockBuffer ) {
222213 try {
223- return getParseBunLockb ( ) ( lockBuffer )
214+ return parseBunLockb ( lockBuffer )
224215 } catch { }
225216 }
226217 // To print a Yarn lockfile to your console without writing it to disk
You can’t perform that action at this time.
0 commit comments