@@ -18,7 +18,6 @@ const getPackageMapPath = getLazy(() =>
1818 require ( 'internal/options' ) . getOptionValue ( '--experimental-package-map' ) ,
1919) ;
2020const fs = require ( 'fs' ) ;
21- const { fileURLToPath } = require ( 'internal/url' ) ;
2221
2322const {
2423 ERR_PACKAGE_MAP_ACCESS_DENIED ,
@@ -88,7 +87,7 @@ class PackageMap {
8887 this . #packages. set ( key , {
8988 path : absolutePath ,
9089 dependencies : new SafeSet ( entry . dependencies ?? [ ] ) ,
91- name : entry . name , // undefined for nameless packages
90+ name : entry . name , // Undefined for nameless packages
9291 } ) ;
9392
9493 // Index by name (only named packages)
@@ -114,7 +113,7 @@ class PackageMap {
114113 */
115114 #getKeyForPath( filePath ) {
116115 const cached = this . #pathToKeyCache. get ( filePath ) ;
117- if ( cached !== undefined ) return cached ;
116+ if ( cached !== undefined ) { return cached ; }
118117
119118 // Walk up to find containing package
120119 let checkPath = filePath ;
@@ -126,7 +125,7 @@ class PackageMap {
126125 return key ;
127126 }
128127 const parent = dirname ( checkPath ) ;
129- if ( parent === checkPath ) break ;
128+ if ( parent === checkPath ) { break ; }
130129 checkPath = parent ;
131130 }
132131
@@ -146,7 +145,7 @@ class PackageMap {
146145 const parentKey = this . #getKeyForPath( parentPath ) ;
147146
148147 // Parent not in map - fall back to standard resolution
149- if ( parentKey === null ) return undefined ;
148+ if ( parentKey === null ) { return undefined ; }
150149
151150 // Check cache
152151 const cacheKey = `${ parentKey } \0${ specifier } ` ;
@@ -281,7 +280,7 @@ function emitExperimentalWarning() {
281280 * @returns {PackageMap|null }
282281 */
283282function getPackageMap ( ) {
284- if ( packageMap !== undefined ) return packageMap ;
283+ if ( packageMap !== undefined ) { return packageMap ; }
285284
286285 packageMapPath = getPackageMapPath ( ) ;
287286 if ( ! packageMapPath ) {
@@ -306,7 +305,6 @@ function hasPackageMap() {
306305 * Resolve a package specifier using the package map.
307306 * Returns the package path and subpath, or undefined if resolution should
308307 * fall back to standard resolution.
309- *
310308 * @param {string } specifier - The bare specifier (e.g., "lodash", "react/jsx-runtime")
311309 * @param {string } parentPath - File path of the importing module
312310 * @returns {{packagePath: string, subpath: string}|undefined }
0 commit comments