mirror of
https://github.com/soconnor0919/beenpad.git
synced 2026-02-05 00:06:40 -05:00
first commit
This commit is contained in:
35
node_modules/vitest/dist/chunks/modules.DJPjQW6m.js
generated
vendored
Normal file
35
node_modules/vitest/dist/chunks/modules.DJPjQW6m.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import { builtinModules } from 'node:module';
|
||||
|
||||
// copied from vite
|
||||
// https://github.com/vitejs/vite/blob/814120f2ad387ca3d1e16c7dd403b04ca4b97f75/packages/vite/src/node/utils.ts#L106
|
||||
// Supported by Node, Deno, Bun
|
||||
const NODE_BUILTIN_NAMESPACE = "node:";
|
||||
// Supported by Deno
|
||||
const NPM_BUILTIN_NAMESPACE = "npm:";
|
||||
// Supported by Bun
|
||||
const BUN_BUILTIN_NAMESPACE = "bun:";
|
||||
// Some runtimes like Bun injects namespaced modules here, which is not a node builtin
|
||||
const nodeBuiltins = builtinModules.filter((id) => !id.includes(":"));
|
||||
// TODO: Use `isBuiltin` from `node:module`, but Deno doesn't support it
|
||||
function isBuiltin(id) {
|
||||
if (process.versions.deno && id.startsWith(NPM_BUILTIN_NAMESPACE)) return true;
|
||||
if (process.versions.bun && id.startsWith(BUN_BUILTIN_NAMESPACE)) return true;
|
||||
return isNodeBuiltin(id);
|
||||
}
|
||||
function isNodeBuiltin(id) {
|
||||
if (id.startsWith(NODE_BUILTIN_NAMESPACE)) return true;
|
||||
return nodeBuiltins.includes(id);
|
||||
}
|
||||
const browserExternalId = "__vite-browser-external";
|
||||
const browserExternalLength = 24;
|
||||
function isBrowserExternal(id) {
|
||||
return id.startsWith(browserExternalId);
|
||||
}
|
||||
function toBuiltin(id) {
|
||||
if (id.startsWith(browserExternalId)) id = id.slice(browserExternalLength);
|
||||
if (id.startsWith(NPM_BUILTIN_NAMESPACE) || id.startsWith(BUN_BUILTIN_NAMESPACE) || id.startsWith(NODE_BUILTIN_NAMESPACE)) return id;
|
||||
if (process.versions.deno || process.versions.bun) return id;
|
||||
return `node:${id}`;
|
||||
}
|
||||
|
||||
export { isBrowserExternal as a, isBuiltin as i, toBuiltin as t };
|
||||
Reference in New Issue
Block a user