/**
 * A function that detects which runtime the code is running on.
 * 
 * @returns The name of the runtime being run on, or `null` if the runtime could not be detected.
 */
export function detect(): "browser" | "node" | "deno" | null {
  if ("Deno" in globalThis) return "deno";
  if ("process" in globalThis) return "node";
  if ("document" in globalThis) return "browser";
  return null;
}
