
Because we can have arbitrary in- and export names with strings we can have '*' and '' which means using '*' as an indicating namespace imports failed / behaved incorrectly for string imports '*'. We now use more specific types to indicate these special states instead of these 'magic' string values. Do note that 'default' is not actually a magic string value but one specified by the spec. And you can in fact export the default value by doing: `export { 1 as default }`.
8 lines
273 B
JavaScript
8 lines
273 B
JavaScript
import * as ns from "./default-and-star-export.mjs";
|
|
import defaultExport from "./default-and-star-export.mjs";
|
|
|
|
export const passed =
|
|
ns.default === "defaultValue" &&
|
|
ns["*"] === "starExportValue" &&
|
|
ns[""] === "empty" &&
|
|
defaultExport === "defaultValue";
|