mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-23 06:10:02 +08:00
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
// Named ESM imports of the shapes Node's lexer CAN see across the CJS
|
|
// reexport chain (table-value require -> tsc __exportStar -> Babel loop
|
|
// -> leaf). The union contributes NAMES only: index.js never copies the
|
|
// chain's properties onto its own exports object, so the unioned bindings
|
|
// link fine and hold undefined — while the same values are real own
|
|
// properties one hop down (viaTable.*), and the lexer-invisible getter
|
|
// stays reachable through the DEFAULT import (always module.exports
|
|
// itself, getters live).
|
|
import def, { viaTable, direct, fromTsc, fromBabel, fromLeaf } from "lexzoo";
|
|
import gt from "lexzoo/getters.js";
|
|
import * as zoo from "lexzoo";
|
|
|
|
export function bridge() {
|
|
return [
|
|
direct,
|
|
String(fromTsc),
|
|
String(fromBabel),
|
|
String(fromLeaf),
|
|
viaTable.fromTsc,
|
|
viaTable.fromBabel,
|
|
viaTable.fromLeaf,
|
|
typeof viaTable,
|
|
String(def.neverSeen),
|
|
gt.hidden,
|
|
].join(" ");
|
|
}
|
|
|
|
// The namespace's key set pins the synthesized export list itself:
|
|
// viaTable/direct plus the unioned reexport names, never neverSeen.
|
|
export function names() {
|
|
return Object.keys(zoo).join("|");
|
|
}
|