Implements most platform-independent features

This commit is contained in:
2022-06-28 16:22:49 +00:00
committed by GitHub
parent ee091206b3
commit f3c0d646e3
18 changed files with 584 additions and 0 deletions

16
src/lib.ts Normal file
View File

@ -0,0 +1,16 @@
export const firstUpperCase = ([first, ...rest]: string) =>
first?.toUpperCase() + rest.join("");
export const platform = (() => {
if (typeof process != "undefined") {
return "Node.js";
}
return "UNKNOWN";
})();
export const version = (() => {
switch (platform) {
case "Node.js":
return process.version;
default:
return "UNKNOWN";
}
})();