callable-instance2
Version:
Instances of classes which are directly callable as functions.
20 lines (17 loc) • 780 B
JavaScript
;
function CallableInstance(e) {
const t = this.constructor.prototype[e], apply = function() {
return t.apply(apply, arguments);
};
return Object.setPrototypeOf(apply, this.constructor.prototype), Object.getOwnPropertyNames(t).forEach((function(e) {
Object.defineProperty(apply, e, Object.getOwnPropertyDescriptor(t, e));
})), apply;
}
CallableInstance.prototype = /*#__PURE__*/ Object.create(Function.prototype), Object.defineProperty(CallableInstance, "__esModule", {
value: !0
}), Object.defineProperty(CallableInstance, "CallableInstance", {
value: CallableInstance
}), Object.defineProperty(CallableInstance, "default", {
value: CallableInstance
}), module.exports = CallableInstance;
//# sourceMappingURL=index.cjs.production.min.cjs.map