@pawover/kit 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +15 -15
- package/packages/hooks/dist/alova.d.ts +7 -4
- package/packages/hooks/dist/alova.js +13 -27
- package/packages/hooks/dist/react.d.ts +2 -4
- package/packages/hooks/dist/react.js +52 -35
- package/packages/utils/dist/index.d.ts +432 -347
- package/packages/utils/dist/index.js +3 -4
- package/packages/utils/dist/math.d.ts +0 -1
- package/packages/utils/dist/math.js +1 -1
- package/packages/utils/dist/{stringUtil-CaY_wCS-.js → stringUtil-DbYpnL4l.js} +17 -0
- package/packages/utils/dist/vite.d.ts +0 -1
- package/packages/zod/dist/index.d.ts +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as TypeUtil, t as StringUtil } from "./stringUtil-
|
|
1
|
+
import { n as TypeUtil, t as StringUtil } from "./stringUtil-DbYpnL4l.js";
|
|
2
2
|
//#region src/array/arrayUtil.ts
|
|
3
3
|
/**
|
|
4
4
|
* 数组工具类
|
|
@@ -667,9 +667,8 @@ var FunctionUtil = class {
|
|
|
667
667
|
* ```
|
|
668
668
|
*/
|
|
669
669
|
static toArgs(args, start) {
|
|
670
|
-
if (args === null) throw new TypeError(`function [toArgs] Expected parameter [args] to be a arguments object, got ${typeof args}`);
|
|
671
|
-
|
|
672
|
-
return TypeUtil.isNumber(start) ? array.slice(start) : array;
|
|
670
|
+
if (args === null || args === void 0) throw new TypeError(`function [toArgs] Expected parameter [args] to be a arguments object, got ${typeof args}`);
|
|
671
|
+
return Array.prototype.slice.call(args, start);
|
|
673
672
|
}
|
|
674
673
|
/**
|
|
675
674
|
* 将同步或异步函数统一包装为 Promise
|
|
@@ -355,6 +355,23 @@ var TypeUtil = class {
|
|
|
355
355
|
return prototypeCheck ? check && Object.getPrototypeOf(value) === Object.prototype : check;
|
|
356
356
|
}
|
|
357
357
|
/**
|
|
358
|
+
* 判断是否为广义对象类型
|
|
359
|
+
*
|
|
360
|
+
* @param value 待检查值
|
|
361
|
+
* @returns 是否为对象
|
|
362
|
+
* @example
|
|
363
|
+
* ```ts
|
|
364
|
+
* TypeUtil.isObject({}); // true
|
|
365
|
+
* TypeUtil.isObject([]); // true
|
|
366
|
+
* TypeUtil.isObject(new Date()); // true
|
|
367
|
+
* TypeUtil.isObject(null); // false
|
|
368
|
+
* TypeUtil.isObject("string"); // false
|
|
369
|
+
* ```
|
|
370
|
+
*/
|
|
371
|
+
static isObject(value) {
|
|
372
|
+
return typeof value === "object" && value !== null;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
358
375
|
* 判断一个对象是否为有效的枚举
|
|
359
376
|
* - 枚举成员不能为空
|
|
360
377
|
* - 枚举成员的键不能具有数值名
|