@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.
@@ -5475,7 +5475,7 @@ var Utils = (function () {
5475
5475
  }
5476
5476
  const domUtils = new DOMUtils();
5477
5477
 
5478
- const version = "2.9.0";
5478
+ const version = "2.9.2";
5479
5479
 
5480
5480
  class Utils {
5481
5481
  windowApi;
@@ -8193,6 +8193,23 @@ var Utils = (function () {
8193
8193
  this.windowApi.clearInterval(timeId);
8194
8194
  }
8195
8195
  }
8196
+ createFunction(...args) {
8197
+ let isAsync = args[args.length - 1];
8198
+ if (typeof isAsync === "boolean") {
8199
+ args.splice(args.length - 1, 1);
8200
+ }
8201
+ else {
8202
+ isAsync = false;
8203
+ }
8204
+ if (isAsync) {
8205
+ const AsyncFunctionConstructor = Object.getPrototypeOf(async function () { }).constructor;
8206
+ return new AsyncFunctionConstructor(...args);
8207
+ }
8208
+ else {
8209
+ const FunctionConstructor = Object.getPrototypeOf(function () { }).constructor;
8210
+ return new FunctionConstructor(...args);
8211
+ }
8212
+ }
8196
8213
  }
8197
8214
  const utils = new Utils();
8198
8215