@aituber-onair/kizuna
Version:
A sophisticated bond system (絆 - Kizuna) for managing relationships between users and AI characters in AITuber OnAir.
35 lines • 911 B
JavaScript
/**
* Environment detection utility
* Detects browser and Node.js environments
*/
/**
* Detect current execution environment
*/
export function detectEnvironment() {
// Detect browser environment by window object existence
if (typeof window !== "undefined" &&
typeof window.localStorage !== "undefined") {
return "browser";
}
// Detect Node.js environment by process object existence
if (typeof process !== "undefined" &&
process.versions &&
process.versions.node) {
return "node";
}
// Default to Node.js environment
return "node";
}
/**
* Check if running in browser environment
*/
export function isBrowser() {
return detectEnvironment() === "browser";
}
/**
* Check if running in Node.js environment
*/
export function isNode() {
return detectEnvironment() === "node";
}
//# sourceMappingURL=environmentDetector.js.map