Files
SnowLuma/.pnpm-store/v11/files/cc/431aaa075e3c08b1c14228777f6111666a9775a7d1535a01a0c3d58424d8760f1926cdf805d86a95e12820bed33cfc10c22cbbaaf0ea3567596aeeca4c924d
TanTan 2a69b23b47
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

98 lines
3.2 KiB
Plaintext

(function(global, factory) {
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.IsWhatType = {}));
})(this, function(exports2) {
"use strict";
function ensureType(value, checked) {
return checked;
}
function getType(value) {
return Object.prototype.toString.call(value).slice(8, -1);
}
const PROTOCOL = /^([a-z][a-z\d+\-.]*:)?\/\//i;
function isAbsoluteURL(value) {
return PROTOCOL.test(value);
}
function isLength(value) {
return Number.isInteger(value) && value > -1;
}
function isArrayLike(value) {
return value != null && isLength(value.length) && typeof value !== "function";
}
function isAsyncFunction(value) {
return getType(value) === "AsyncFunction";
}
function isObject(value) {
return value !== null && typeof value === "object";
}
const hasSymbol = typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol";
function isESModule(value) {
return isObject(value) && (value.__esModule || hasSymbol && value[Symbol.toStringTag] === "Module");
}
function isError(value) {
if (value == null) {
return false;
}
if (value instanceof Error) {
return true;
}
const { name } = value;
return typeof name === "string" && name.endsWith("Error");
}
function isFunction(value) {
return typeof value === "function";
}
function isIterable(value) {
return value != null && typeof value[Symbol.iterator] === "function";
}
function isNumber(value) {
return typeof value === "number" && value === value;
}
function isValidDate(value) {
return value instanceof Date && value.toString() !== "Invalid Date";
}
function isLeapYear(value) {
let year = value;
if (isValidDate(value)) {
year = value.getFullYear();
} else if (!isNumber(value)) {
return false;
}
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
}
function isNil(value) {
return value == null;
}
function isPlainObject(value) {
if (!isObject(value) || getType(value) !== "Object") {
return false;
}
const prototype = Object.getPrototypeOf(value);
return prototype === null || prototype === Object.prototype;
}
function isPromiseLike(value) {
return isObject(value) && typeof value.then === "function";
}
function isWhat(value, type, comparingType) {
return type === comparingType;
}
exports2.ensureType = ensureType;
exports2.getType = getType;
exports2.isAbsoluteURL = isAbsoluteURL;
exports2.isArrayLike = isArrayLike;
exports2.isAsyncFunction = isAsyncFunction;
exports2.isESModule = isESModule;
exports2.isError = isError;
exports2.isFunction = isFunction;
exports2.isIterable = isIterable;
exports2.isLeapYear = isLeapYear;
exports2.isLength = isLength;
exports2.isNil = isNil;
exports2.isNumber = isNumber;
exports2.isObject = isObject;
exports2.isPlainObject = isPlainObject;
exports2.isPromiseLike = isPromiseLike;
exports2.isValidDate = isValidDate;
exports2.isWhat = isWhat;
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
});