fix types & add bun adapater (WIP)

This commit is contained in:
2022-07-26 08:32:33 +00:00
parent f87ab5366e
commit b1558bd9fa
6 changed files with 66 additions and 11 deletions

View File

@ -7,6 +7,9 @@ export const platform = (() => {
if (typeof Deno != "undefined") {
return "Deno";
}
if (typeof Bun != "undefined") {
return "Bun";
}
if (typeof tjs != "undefined") {
return "txiki.js";
}
@ -17,7 +20,7 @@ export const platform = (() => {
})();
export const version = (() => {
switch (platform) {
case "Node.js":
case "Node.js" || "Bun":
return process.version;
case "Deno":
return Deno.version.deno;