Skip to content
This repository was archived by the owner on Sep 19, 2025. It is now read-only.

Commit 5edb687

Browse files
committed
init runtime environment check
1 parent c337ad2 commit 5edb687

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

js/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This runtime check will eventually become obselete as static exports will become the standard
2+
// https://runtime-keys.proposal.wintercg.org/#example-usage
3+
4+
if (globalThis.navigator?.userAgent === "Cloudflare-Workers") {
5+
// https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent
6+
} else if (globalThis.process?.release?.name === "node") {
7+
// https://nodejs.org/api/process.html#processrelease
8+
} else if (globalThis.Deno) {
9+
}

0 commit comments

Comments
 (0)