mirror of
https://github.com/186526/handlers.js
synced 2024-10-13 00:29:43 +00:00
Add CI & Deno Supported & Fix a lot of bugs & Webpack for building package
This commit is contained in:
16
src/lib.ts
16
src/lib.ts
@ -4,17 +4,23 @@ export const platform = (() => {
|
||||
if (typeof process != "undefined") {
|
||||
return "Node.js";
|
||||
}
|
||||
if (typeof self != "undefined") {
|
||||
return "Web Worker";
|
||||
if (typeof Deno != "undefined") {
|
||||
return "Deno";
|
||||
}
|
||||
|
||||
return "Unknown";
|
||||
if (typeof self != "undefined") {
|
||||
return "Service Worker";
|
||||
}
|
||||
return undefined;
|
||||
})();
|
||||
export const version = (() => {
|
||||
switch (platform) {
|
||||
case "Node.js":
|
||||
return process.version;
|
||||
case "Deno":
|
||||
return Deno.version.deno;
|
||||
case "Service Worker":
|
||||
return undefined;
|
||||
default:
|
||||
return "Unknown";
|
||||
return undefined;
|
||||
}
|
||||
})();
|
||||
|
Reference in New Issue
Block a user