* Reads a node builtin via `process.getBuiltinModule()`, guarded to stay falsy off node so universal `["node", "web"]` bundles don't crash (also falsy on node <22.3). * @param {string} request builtin module request as a JS string expression, e.g. from `renderNodePrefixForCoreModule` * @param {s
(request, access = "")
| 398 | * @returns {string} guarded expression |
| 399 | */ |
| 400 | getBuiltinModule(request, access = "") { |
| 401 | const getter = `process.getBuiltinModule(${request})${access}`; |
| 402 | if (this.outputOptions.environment.nodeBuiltinModuleGetter) { |
| 403 | return `typeof process !== "undefined" && ${getter}`; |
| 404 | } |
| 405 | return `typeof process !== "undefined" && typeof process.getBuiltinModule === "function" && ${getter}`; |
| 406 | } |
| 407 | |
| 408 | /** |
| 409 | * Renders an object-literal method, using method shorthand when supported |
no outgoing calls
no test coverage detected