mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-24 06:14:01 +08:00
30 lines
963 B
JavaScript
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("|");
|
|
}
|