get the global-runtime-object of the given javascript environment RUNTIME enum.

Note

if you acquire the global-runtime-object of an environment that is not supported by your actual current environment, then the returned value will be undefined.

import { assertEquals } from "jsr:@std/assert"
import process from "node:process" // this works in deno 2.0

assertEquals(getRuntime(RUNTIME.DENO), Deno)
assertEquals(getRuntime(RUNTIME.NODE), process)
assertEquals(getRuntime(identifyCurrentRuntime()), Deno)