@whitesev/utils 2.9.0 → 2.9.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/dist/index.amd.js +18 -1
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +18 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +18 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +18 -1
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +18 -1
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +18 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/Utils.d.ts +38 -0
- package/dist/types/src/types/ajaxHooker.d.ts +3 -1
- package/package.json +8 -11
- package/src/Utils.ts +51 -0
- package/src/types/ajaxHooker.d.ts +3 -1
package/dist/index.umd.js
CHANGED
|
@@ -5478,7 +5478,7 @@
|
|
|
5478
5478
|
}
|
|
5479
5479
|
const domUtils = new DOMUtils();
|
|
5480
5480
|
|
|
5481
|
-
const version = "2.9.
|
|
5481
|
+
const version = "2.9.2";
|
|
5482
5482
|
|
|
5483
5483
|
class Utils {
|
|
5484
5484
|
windowApi;
|
|
@@ -8196,6 +8196,23 @@
|
|
|
8196
8196
|
this.windowApi.clearInterval(timeId);
|
|
8197
8197
|
}
|
|
8198
8198
|
}
|
|
8199
|
+
createFunction(...args) {
|
|
8200
|
+
let isAsync = args[args.length - 1];
|
|
8201
|
+
if (typeof isAsync === "boolean") {
|
|
8202
|
+
args.splice(args.length - 1, 1);
|
|
8203
|
+
}
|
|
8204
|
+
else {
|
|
8205
|
+
isAsync = false;
|
|
8206
|
+
}
|
|
8207
|
+
if (isAsync) {
|
|
8208
|
+
const AsyncFunctionConstructor = Object.getPrototypeOf(async function () { }).constructor;
|
|
8209
|
+
return new AsyncFunctionConstructor(...args);
|
|
8210
|
+
}
|
|
8211
|
+
else {
|
|
8212
|
+
const FunctionConstructor = Object.getPrototypeOf(function () { }).constructor;
|
|
8213
|
+
return new FunctionConstructor(...args);
|
|
8214
|
+
}
|
|
8215
|
+
}
|
|
8199
8216
|
}
|
|
8200
8217
|
const utils = new Utils();
|
|
8201
8218
|
|