callable-instance2
Version:
Instances of classes which are directly callable as functions.
14 lines (11 loc) • 527 B
JavaScript
function CallableInstance(t) {
const e = this.constructor.prototype[t], apply = function() {
return e.apply(apply, arguments);
};
return Object.setPrototypeOf(apply, this.constructor.prototype), Object.getOwnPropertyNames(e).forEach((function(t) {
Object.defineProperty(apply, t, Object.getOwnPropertyDescriptor(e, t));
})), apply;
}
CallableInstance.prototype = /*#__PURE__*/ Object.create(Function.prototype);
export { CallableInstance, CallableInstance as default };
//# sourceMappingURL=index.esm.mjs.map