Files
NapCatQQ/.pnpm-store/v3/files/14/954971247b258d2ae4d333e8b5070432f634eab756ffd4b8fb3bd82a75eb3a59a229d75e83716652ff528b04588f7f6785463719c3ecc31c816b724a37825f
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

44 lines
1.0 KiB
Plaintext

// src/assertion.ts
var __DEV__ = process.env.NODE_ENV !== "production";
var __TEST__ = process.env.NODE_ENV === "test";
function isArray(value) {
return Array.isArray(value);
}
function isEmptyArray(value) {
return isArray(value) && value.length === 0;
}
function isObject(value) {
const type = typeof value;
return value != null && (type === "object" || type === "function") && !isArray(value);
}
function isEmptyObject(value) {
return isObject(value) && Object.keys(value).length === 0;
}
function isEmpty(value) {
if (isArray(value))
return isEmptyArray(value);
if (isObject(value))
return isEmptyObject(value);
if (value == null || value === "")
return true;
return false;
}
function isFunction(value) {
return typeof value === "function";
}
var dataAttr = (condition) => condition ? "true" : void 0;
var isNumeric = (value) => value != null && parseInt(value.toString(), 10) > 0;
export {
__DEV__,
__TEST__,
isArray,
isEmptyArray,
isObject,
isEmptyObject,
isEmpty,
isFunction,
dataAttr,
isNumeric
};