Files
scriptc/tests/fixtures/npm/node_modules/esmbridge/index.js
2026-07-22 18:08:04 -05:00

30 lines
963 B
JavaScript

// An ES module doing NAMED imports of a CommonJS module INSIDE the package
// graph — the shape Node resolves by lexing the CJS source at link time
// (@ai-sdk/gateway importing { getContext } from @vercel/oidc). Includes
// the string ModuleExportName form, the "module.exports" alias Node ships,
// and a lexed-but-unassigned name (a live binding of undefined).
import def, { alpha, beta, gamma, delta, epsilon, extra, phantom, "dash-name" as dash } from "cjszoo";
import { "module.exports" as mexp } from "cjszoo";
import * as zoo from "cjszoo";
export function bridge() {
return [
alpha,
beta,
gamma(),
delta(),
epsilon,
extra,
dash,
String(phantom),
String(mexp === def),
typeof def,
].join(" ");
}
// The namespace object's key set (spec-sorted) — pins the synthesized
// export list itself, including "module.exports" and the phantom name.
export function names() {
return Object.keys(zoo).join("|");
}