Update from Vibe Studio

This commit is contained in:
Vibe Studio
2026-01-09 14:52:46 +00:00
parent 42a0efe70b
commit 47fa6d98b2
28661 changed files with 2421771 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isBrowser = void 0;
var isNode = typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
/**
* 用于判断当前是否在浏览器环境中。
* 首先会判断当前是否处于测试环境中(通过 process.env.NODE_ENV === 'TEST' 判断),
* 如果是,则返回 true。否则会进一步判断是否存在 window 对象、document 对象以及 matchMedia 方法
* 同时通过 !isNode 判断当前不是在服务器Node.js环境下执行
* 如果都符合,则返回 true 表示当前处于浏览器环境中。
* @returns boolean
*/
var isBrowser = exports.isBrowser = function isBrowser() {
if (typeof process !== 'undefined' && process.env.NODE_ENV === 'TEST') {
return true;
}
return typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.matchMedia !== 'undefined' && !isNode;
};