Skip to content

Commit eb80d60

Browse files
committed
refactor(environment): use ES module import for bun lockfile parser
Changed from require() to ES module import for @socketregistry/hyrious__bun.lockb. Before: const { parse } = require('@socketregistry/hyrious__bun.lockb/index.cjs') After: import { parse as parseBunLockb } from '@socketregistry/hyrious__bun.lockb/index.cjs'
1 parent a9b20c6 commit eb80d60

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packages/cli/src/utils/ecosystem/environment.mts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,11 @@ import { existsSync } from 'node:fs'
2828
import { createRequire } from 'node:module'
2929
import path from 'node:path'
3030

31+
import { parse as parseBunLockb } from '@socketregistry/hyrious__bun.lockb/index.cjs'
3132
import browserslist from 'browserslist'
3233
import semver from 'semver'
3334

3435
const require = createRequire(import.meta.url)
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
39-
}
4036

4137
import { whichBin } from '@socketsecurity/lib/bin'
4238
import {

0 commit comments

Comments
 (0)