'use strict'; const CLOUDFLARE_WORKERS_NAVIGATOR = "Cloudflare-Workers"; const NODE_PROCESS_RELEASE_NAME = "node"; function detectRuntime() { if (typeof Netlify === "object") { return "netlify"; } if (typeof EdgeRuntime === "string") { return "edge-light"; } if (globalThis.navigator?.userAgent === CLOUDFLARE_WORKERS_NAVIGATOR) { return "workerd"; } if (globalThis.Deno) { return "deno"; } if (globalThis.__lagon__) { return "lagon"; } if (globalThis.process?.release?.name === NODE_PROCESS_RELEASE_NAME) { return "node"; } if (globalThis.Bun) { return "bun"; } if (globalThis.fastly) { return "fastly"; } return "unknown"; } exports.detectRuntime = detectRuntime;