mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-27 01:19:25 +08:00
perf(panel): optimize P1 hot paths and consolidate P2 shared primitives
This commit is contained in:
@@ -13,6 +13,16 @@ function resolveHttpHelperPanelDir() {
|
||||
return /[\\/]backend$/i.test(modDir) ? dirname(modDir) : modDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断输入值是否为非数组普通对象(Plain Object)。
|
||||
*
|
||||
* @param {unknown} v
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function isPlainObject(v) {
|
||||
return Boolean(v) && typeof v === 'object' && !Array.isArray(v);
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步读取 `sidecars/panel` 目录下的静态资源文件(兼容单元测试同步沙箱)。
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user