Add Web Worker Platform Adapter && Fix module path bug

This commit is contained in:
2022-06-29 20:00:52 +00:00
committed by GitHub
parent bdbb5deda9
commit b3552cb6a2
17 changed files with 4765 additions and 56 deletions

View File

@ -4,13 +4,17 @@ export const platform = (() => {
if (typeof process != "undefined") {
return "Node.js";
}
return "UNKNOWN";
if (typeof self != "undefined") {
return "Web Worker";
}
return "Unknown";
})();
export const version = (() => {
switch (platform) {
case "Node.js":
return process.version;
default:
return "UNKNOWN";
return "Unknown";
}
})();