@ceale/util 1.12.4 → 1.12.5
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/dist/cjs/index.js +0 -18
- package/dist/esm/index.js +0 -5
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
3
1
|
var __defProp = Object.defineProperty;
|
|
4
2
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
8
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
9
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
10
|
-
for (let key of __getOwnPropNames(mod))
|
|
11
|
-
if (!__hasOwnProp.call(to, key))
|
|
12
|
-
__defProp(to, key, {
|
|
13
|
-
get: () => mod[key],
|
|
14
|
-
enumerable: true
|
|
15
|
-
});
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
5
|
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
19
6
|
var __toCommonJS = (from) => {
|
|
20
7
|
var entry = __moduleCache.get(from), desc;
|
|
@@ -424,7 +411,6 @@ class CubicBezier {
|
|
|
424
411
|
}
|
|
425
412
|
}
|
|
426
413
|
// src/error.ts
|
|
427
|
-
var import_promises = __toESM(require("node:fs/promises"));
|
|
428
414
|
var tryCatch = (parameter) => {
|
|
429
415
|
if (typeof parameter === "object") {
|
|
430
416
|
return parameter.then((data) => Object.assign([data, null], { data, error: null })).catch((error) => Object.assign([null, error], { data: null, error }));
|
|
@@ -439,7 +425,3 @@ var tryCatch = (parameter) => {
|
|
|
439
425
|
}
|
|
440
426
|
throw new TypeError("参数类型错误,应为 Promise 或函数");
|
|
441
427
|
};
|
|
442
|
-
(async () => {
|
|
443
|
-
const a = await tryCatch(import_promises.default.stat("a.txt"));
|
|
444
|
-
console.log(typeof a);
|
|
445
|
-
})();
|
package/dist/esm/index.js
CHANGED
|
@@ -364,7 +364,6 @@ class CubicBezier {
|
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
// src/error.ts
|
|
367
|
-
import fs from "node:fs/promises";
|
|
368
367
|
var tryCatch = (parameter) => {
|
|
369
368
|
if (typeof parameter === "object") {
|
|
370
369
|
return parameter.then((data) => Object.assign([data, null], { data, error: null })).catch((error) => Object.assign([null, error], { data: null, error }));
|
|
@@ -379,10 +378,6 @@ var tryCatch = (parameter) => {
|
|
|
379
378
|
}
|
|
380
379
|
throw new TypeError("参数类型错误,应为 Promise 或函数");
|
|
381
380
|
};
|
|
382
|
-
(async () => {
|
|
383
|
-
const a = await tryCatch(fs.stat("a.txt"));
|
|
384
|
-
console.log(typeof a);
|
|
385
|
-
})();
|
|
386
381
|
export {
|
|
387
382
|
waitSync,
|
|
388
383
|
wait,
|