@@ -1090,10 +1090,9 @@ E('ERR_INVALID_MODULE_SPECIFIER', (pkgPath, subpath, base = undefined) => {
1090
1090
assert ( subpath !== '.' ) ;
1091
1091
return `Package subpath '${ subpath } ' is not a valid module request for ` +
1092
1092
`the "exports" resolution of ${ pkgPath } ${ sep } package.json` ;
1093
- } else {
1094
- return `Package subpath '${ subpath } ' is not a valid module request for ` +
1095
- `the "exports" resolution of ${ pkgPath } imported from ${ base } ` ;
1096
1093
}
1094
+ return `Package subpath '${ subpath } ' is not a valid module request for ` +
1095
+ `the "exports" resolution of ${ pkgPath } imported from ${ base } ` ;
1097
1096
} , TypeError ) ;
1098
1097
E ( 'ERR_INVALID_OPT_VALUE' , ( name , value ) =>
1099
1098
`The value "${ String ( value ) } " is invalid for option "${ name } "` ,
@@ -1104,8 +1103,7 @@ E('ERR_INVALID_OPT_VALUE_ENCODING',
1104
1103
E ( 'ERR_INVALID_PACKAGE_CONFIG' , ( path , message , hasMessage = true ) => {
1105
1104
if ( hasMessage )
1106
1105
return `Invalid package config ${ path } ${ sep } package.json, ${ message } ` ;
1107
- else
1108
- return `Invalid JSON in ${ path } imported from ${ message } ` ;
1106
+ return `Invalid JSON in ${ path } imported from ${ message } ` ;
1109
1107
} , Error ) ;
1110
1108
E ( 'ERR_INVALID_PACKAGE_TARGET' ,
1111
1109
( pkgPath , key , subpath , target , base = undefined ) => {
@@ -1116,11 +1114,10 @@ E('ERR_INVALID_PACKAGE_TARGET',
1116
1114
return `Invalid "exports" target ${ JSONStringify ( target ) } defined ` +
1117
1115
`for '${ subpath } ' in the package config ${ pkgPath } imported from ` +
1118
1116
`${ base } .${ relError ? '; targets must start with "./"' : '' } ` ;
1119
- } else {
1120
- return `Invalid "exports" main target ${ target } defined in the ` +
1121
- `package config ${ pkgPath } imported from ${ base } ${ relError ?
1122
- '; targets must start with "./"' : '' } `;
1123
1117
}
1118
+ return `Invalid "exports" main target ${ target } defined in the ` +
1119
+ `package config ${ pkgPath } imported from ${ base } ${ relError ?
1120
+ '; targets must start with "./"' : '' } `;
1124
1121
} else if ( key === '.' ) {
1125
1122
return `Invalid "exports" main target ${ JSONStringify ( target ) } defined ` +
1126
1123
`in the package config ${ pkgPath } ${ sep } package.json${ relError ?
@@ -1130,11 +1127,10 @@ E('ERR_INVALID_PACKAGE_TARGET',
1130
1127
StringPrototypeSlice ( key , 0 , - subpath . length || key . length ) } ' in the ` +
1131
1128
`package config ${ pkgPath } ${ sep } package.json; ` +
1132
1129
'targets must start with "./"' ;
1133
- } else {
1134
- return `Invalid "exports" target ${ JSONStringify ( target ) } defined for '${
1135
- StringPrototypeSlice ( key , 0 , - subpath . length || key . length ) } ' in the ` +
1136
- `package config ${ pkgPath } ${ sep } package.json` ;
1137
1130
}
1131
+ return `Invalid "exports" target ${ JSONStringify ( target ) } defined for '${
1132
+ StringPrototypeSlice ( key , 0 , - subpath . length || key . length ) } ' in the ` +
1133
+ `package config ${ pkgPath } ${ sep } package.json` ;
1138
1134
} , Error ) ;
1139
1135
E ( 'ERR_INVALID_PERFORMANCE_MARK' ,
1140
1136
'The "%s" performance mark has not been set' , Error ) ;
@@ -1289,10 +1285,9 @@ E('ERR_PACKAGE_PATH_NOT_EXPORTED', (pkgPath, subpath, base = undefined) => {
1289
1285
} else if ( base === undefined ) {
1290
1286
return `Package subpath '${ subpath } ' is not defined by "exports" in ${
1291
1287
pkgPath } ${ sep } package.json`;
1292
- } else {
1293
- return `Package subpath '${ subpath } ' is not defined by "exports" in ${
1294
- pkgPath } imported from ${ base } `;
1295
1288
}
1289
+ return `Package subpath '${ subpath } ' is not defined by "exports" in ${
1290
+ pkgPath } imported from ${ base } `;
1296
1291
} , Error ) ;
1297
1292
E ( 'ERR_REQUIRE_ESM' ,
1298
1293
( filename , parentPath = null , packageJsonPath = null ) => {
0 commit comments