// eslint-disable-next-line n/no-unsupported-features/node-builtins
const isWorkerd = globalThis.navigator?.userAgent === 'Cloudflare-Workers'
// eslint-disable-next-line n/no-unsupported-features/node-builtins
-const isBrowser = !!globalThis.navigator
+const isBrowser = !!globalThis.window && !!globalThis.navigator
export const runtime = (() => {
if (isBun) return JSRuntime.bun
import type { TimestampedData } from '../../src/types/index.js'
-import { runtime, runtimes } from '../../scripts/runtime.js'
+import { JSRuntime, runtime } from '../../scripts/runtime.js'
import { Constants } from '../../src/utils/Constants.js'
import {
clone,
const date = new Date()
expect(clone(date)).toStrictEqual(date)
expect(clone(date) === date).toBe(false)
- if (runtime === runtimes.node && satisfies(version, '>=22.0.0')) {
+ if (runtime === JSRuntime.node && satisfies(version, '>=22.0.0')) {
const url = new URL('https://domain.tld')
expect(() => clone(url)).toThrow(new Error('Cannot clone object of unsupported type.'))
}