@vscubing/cubing
Version:
A collection of JavaScript cubing libraries.
48 lines (45 loc) • 1.18 kB
JavaScript
// node_modules/getbuiltinmodule-ponyfill/index.js
async function getBuiltinModule(moduleSpecifier) {
const getBuiltinModule2 = globalThis.process?.getBuiltinModule;
if (!getBuiltinModule2) {
return import(moduleSpecifier);
}
return getBuiltinModule2(moduleSpecifier);
}
// src/cubing/vendor/apache/comlink-everywhere/node-adapter.ts
function nodeEndpoint(nep) {
const listeners = /* @__PURE__ */ new WeakMap();
return {
postMessage: nep.postMessage.bind(nep),
addEventListener: (_, eh) => {
const l = (data) => {
if ("handleEvent" in eh) {
eh.handleEvent({ data });
} else {
eh({ data });
}
};
nep.on("message", l);
listeners.set(eh, l);
},
removeEventListener: (_, eh) => {
const l = listeners.get(eh);
if (!l) {
return;
}
nep.off("message", l);
listeners.delete(eh);
},
nodeWorker: nep,
terminate: () => {
nep.terminate();
}
// start: nep.start && nep.start.bind(nep),
};
}
var node_adapter_default = nodeEndpoint;
export {
getBuiltinModule,
node_adapter_default
};
//# sourceMappingURL=chunk-GOT3GVLG.js.map