class-to-invokable.js 608 B

12345678910111213141516171819202122
  1. var __defProp = Object.defineProperty;
  2. var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
  3. var __export = (target, all) => {
  4. __markAsModule(target);
  5. for (var name in all)
  6. __defProp(target, name, { get: all[name], enumerable: true });
  7. };
  8. __export(exports, {
  9. classToInvokable: () => classToInvokable
  10. });
  11. function classToInvokable(Class) {
  12. return new Proxy(Class, {
  13. apply(_target, _thisArg, args) {
  14. return new Class(...args);
  15. },
  16. construct(_target, args) {
  17. return new Class(...args);
  18. }
  19. });
  20. }
  21. //# sourceMappingURL=class-to-invokable.js.map