UNPKG

vue-facing-decorator

Version:

Vue typescript class and decorator based component.

24 lines 911 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.build = exports.decorator = void 0; const utils_1 = require("../utils"); exports.decorator = (0, utils_1.optionNullableMemberDecorator)(function (proto, name, option) { const slot = (0, utils_1.obtainSlot)(proto); const map = slot.obtainMap('inject'); const opt = Object.assign({}, option !== null && option !== void 0 ? option : {}); map.set(name, opt); }); function build(cons, optionBuilder) { var _a; (_a = optionBuilder.inject) !== null && _a !== void 0 ? _a : (optionBuilder.inject = {}); const slot = (0, utils_1.obtainSlot)(cons.prototype); const names = slot.getMap('inject'); if (!names || names.size === 0) { return; } names.forEach((value, name) => { optionBuilder.inject[name] = value; }); } exports.build = build; //# sourceMappingURL=inject.js.map