UNPKG

type-plus

Version:
27 lines 975 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.facade = void 0; function facade(subject, ...props) { return props.reduce((p, k) => { const prop = subject[k]; if (typeof prop === 'function') { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call p[k] = prop.bind(subject); } else { Object.defineProperty(p, k, { get() { // eslint-disable-next-line @typescript-eslint/no-unsafe-return return subject[k]; }, set(value) { // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-assignment return (subject[k] = value); } }); } return p; }, {}); } exports.facade = facade; //# sourceMappingURL=facade.js.map