UNPKG

surrogate

Version:

Object method hooks made easy

33 lines (26 loc) 1.03 kB
var $d5f63c88014791f0$exports = require("./surrogate.b31b7758.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true}); } $parcel$export(module.exports, "OptionsHandler", () => $2f755d1f1cdaf310$export$8bcac92dafadbaee); class $2f755d1f1cdaf310$export$8bcac92dafadbaee { constructor(combinedOptions = {}){ this.combinedOptions = combinedOptions; const options = this.mergeOptions(combinedOptions); Object.entries(options).forEach(([key, value])=>{ Object.defineProperty(this, key, { enumerable: true, value: value }); }); } mergeOptions({ handler: handler = {}, global: global = {} }) { return { ...(0, $d5f63c88014791f0$exports.defaultMethodOptions), ...(0, $d5f63c88014791f0$exports.defaultGlobalOptions), ...global, ...handler }; } } //# sourceMappingURL=surrogate.49912d43.js.map