@@ -1106,10 +1106,9 @@ E('ERR_INVALID_MODULE_SPECIFIER', (pkgPath, subpath, base = undefined) => {
1106
1106
assert ( subpath !== '.' ) ;
1107
1107
return `Package subpath '${ subpath } ' is not a valid module request for ` +
1108
1108
`the "exports" resolution of ${ pkgPath } ${ sep } package.json` ;
1109
- } else {
1110
- return `Package subpath '${ subpath } ' is not a valid module request for ` +
1111
- `the "exports" resolution of ${ pkgPath } imported from ${ base } ` ;
1112
1109
}
1110
+ return `Package subpath '${ subpath } ' is not a valid module request for ` +
1111
+ `the "exports" resolution of ${ pkgPath } imported from ${ base } ` ;
1113
1112
} , TypeError ) ;
1114
1113
E ( 'ERR_INVALID_OPT_VALUE' , ( name , value ) =>
1115
1114
`The value "${ String ( value ) } " is invalid for option "${ name } "` ,
@@ -1120,8 +1119,7 @@ E('ERR_INVALID_OPT_VALUE_ENCODING',
1120
1119
E ( 'ERR_INVALID_PACKAGE_CONFIG' , ( path , message , hasMessage = true ) => {
1121
1120
if ( hasMessage )
1122
1121
return `Invalid package config ${ path } ${ sep } package.json, ${ message } ` ;
1123
- else
1124
- return `Invalid JSON in ${ path } imported from ${ message } ` ;
1122
+ return `Invalid JSON in ${ path } imported from ${ message } ` ;
1125
1123
} , Error ) ;
1126
1124
E ( 'ERR_INVALID_PACKAGE_TARGET' ,
1127
1125
( pkgPath , key , subpath , target , base = undefined ) => {
@@ -1132,11 +1130,10 @@ E('ERR_INVALID_PACKAGE_TARGET',
1132
1130
return `Invalid "exports" target ${ JSONStringify ( target ) } defined ` +
1133
1131
`for '${ subpath } ' in the package config ${ pkgPath } imported from ` +
1134
1132
`${ base } .${ relError ? '; targets must start with "./"' : '' } ` ;
1135
- } else {
1136
- return `Invalid "exports" main target ${ target } defined in the ` +
1137
- `package config ${ pkgPath } imported from ${ base } ${ relError ?
1138
- '; targets must start with "./"' : '' } `;
1139
1133
}
1134
+ return `Invalid "exports" main target ${ target } defined in the ` +
1135
+ `package config ${ pkgPath } imported from ${ base } ${ relError ?
1136
+ '; targets must start with "./"' : '' } `;
1140
1137
} else if ( key === '.' ) {
1141
1138
return `Invalid "exports" main target ${ JSONStringify ( target ) } defined ` +
1142
1139
`in the package config ${ pkgPath } ${ sep } package.json${ relError ?
@@ -1146,11 +1143,10 @@ E('ERR_INVALID_PACKAGE_TARGET',
1146
1143
StringPrototypeSlice ( key , 0 , - subpath . length || key . length ) } ' in the ` +
1147
1144
`package config ${ pkgPath } ${ sep } package.json; ` +
1148
1145
'targets must start with "./"' ;
1149
- } else {
1150
- return `Invalid "exports" target ${ JSONStringify ( target ) } defined for '${
1151
- StringPrototypeSlice ( key , 0 , - subpath . length || key . length ) } ' in the ` +
1152
- `package config ${ pkgPath } ${ sep } package.json` ;
1153
1146
}
1147
+ return `Invalid "exports" target ${ JSONStringify ( target ) } defined for '${
1148
+ StringPrototypeSlice ( key , 0 , - subpath . length || key . length ) } ' in the ` +
1149
+ `package config ${ pkgPath } ${ sep } package.json` ;
1154
1150
} , Error ) ;
1155
1151
E ( 'ERR_INVALID_PERFORMANCE_MARK' ,
1156
1152
'The "%s" performance mark has not been set' , Error ) ;
@@ -1305,10 +1301,9 @@ E('ERR_PACKAGE_PATH_NOT_EXPORTED', (pkgPath, subpath, base = undefined) => {
1305
1301
} else if ( base === undefined ) {
1306
1302
return `Package subpath '${ subpath } ' is not defined by "exports" in ${
1307
1303
pkgPath } ${ sep } package.json`;
1308
- } else {
1309
- return `Package subpath '${ subpath } ' is not defined by "exports" in ${
1310
- pkgPath } imported from ${ base } `;
1311
1304
}
1305
+ return `Package subpath '${ subpath } ' is not defined by "exports" in ${
1306
+ pkgPath } imported from ${ base } `;
1312
1307
} , Error ) ;
1313
1308
E ( 'ERR_REQUIRE_ESM' ,
1314
1309
( filename , parentPath = null , packageJsonPath = null ) => {
0 commit comments