Skip to content

Commit 56113a0

Browse files
committed
fix: drop unused function
1 parent 560bf4c commit 56113a0

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

edge-runtime/lib/cjs.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,6 @@ function parseJson(matchedModule: RegisteredModule) {
3535
}
3636
}
3737

38-
function normalizePackageExports(exports: any) {
39-
if (typeof exports === 'string') {
40-
return { '.': exports }
41-
}
42-
43-
if (Array.isArray(exports)) {
44-
return Object.fromEntries(exports.map((entry) => [entry, entry]))
45-
}
46-
47-
return exports
48-
}
49-
5038
type Condition = string // 'import', 'require', 'default', 'node-addon' etc
5139
type SubpathMatcher = string
5240
type ConditionalTarget = { [key in Condition]: string | ConditionalTarget }
@@ -307,7 +295,8 @@ export function registerCJSModules(baseUrl: URL, modules: Map<string, string>) {
307295
: target.split('/')[0]
308296
const moduleInPackagePath = target.slice(packageName.length + 1)
309297

310-
for (const nodeModulePaths of args[1].paths) {
298+
for (const nodeModulePathsRaw of args[1].paths) {
299+
const nodeModulePaths = toPosixPath(nodeModulePathsRaw)
311300
const potentialPackageJson = join(nodeModulePaths, packageName, 'package.json')
312301

313302
const maybePackageJson = registeredModules.get(potentialPackageJson)

0 commit comments

Comments
 (0)