@whitesev/utils 2.9.0 → 2.9.1

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