UNPKG

459 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3function toFactory(fact) {
4 const detyped = fact;
5 try {
6 const chf = () => new detyped();
7 // Try it to see if it works
8 chf();
9 return chf;
10 }
11 catch (e) {
12 // If we didn't succeed in using the constructor, try the other way
13 return detyped;
14 }
15}
16exports.toFactory = toFactory;
17//# sourceMappingURL=constructionUtils.js.map
\No newline at end of file