Spaces:
Build error
Build error
| ; | |
| var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | |
| var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | |
| if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | |
| else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | |
| return c > 3 && r && Object.defineProperty(target, key, r), r; | |
| }; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.PseudoTransfer = void 0; | |
| const civkit_1 = require("civkit"); | |
| const pseudo_transfer_1 = require("civkit/pseudo-transfer"); | |
| const tsyringe_1 = require("tsyringe"); | |
| let PseudoTransfer = class PseudoTransfer extends pseudo_transfer_1.AbstractPseudoTransfer { | |
| async init() { | |
| await this.dependencyReady(); | |
| this.emit('ready'); | |
| } | |
| }; | |
| exports.PseudoTransfer = PseudoTransfer; | |
| exports.PseudoTransfer = PseudoTransfer = __decorate([ | |
| (0, tsyringe_1.singleton)() | |
| ], PseudoTransfer); | |
| const instance = tsyringe_1.container.resolve(PseudoTransfer); | |
| Object.defineProperty(Error.prototype, pseudo_transfer_1.SYM_PSEUDO_TRANSFERABLE, { | |
| value: function () { | |
| const prototype = this; | |
| return { | |
| copyOwnProperty: 'all', | |
| marshall: (input) => (0, civkit_1.marshalErrorLike)(input), | |
| unMarshall: (input) => { | |
| Object.setPrototypeOf(input, prototype); | |
| return input; | |
| }, | |
| }; | |
| }, | |
| enumerable: false, | |
| }); | |
| instance.expectPseudoTransferableType(Error); | |
| for (const x of [...Object.values(require('./errors')), ...Object.values(require('civkit/civ-rpc'))]) { | |
| if (typeof x === 'function' && x.prototype instanceof Error) { | |
| instance.expectPseudoTransferableType(x); | |
| } | |
| } | |
| Object.defineProperty(URL.prototype, pseudo_transfer_1.SYM_PSEUDO_TRANSFERABLE, { | |
| value: function () { | |
| return { | |
| copyOwnProperty: 'none', | |
| marshall: (input) => ({ href: input.href }), | |
| unMarshall: (input) => new URL(input.href), | |
| }; | |
| }, | |
| enumerable: false, | |
| }); | |
| instance.expectPseudoTransferableType(URL); | |
| Object.defineProperty(Buffer.prototype, pseudo_transfer_1.SYM_PSEUDO_TRANSFERABLE, { | |
| value: function () { | |
| return { | |
| copyOwnProperty: 'none', | |
| unMarshall: (input) => Buffer.isBuffer(input) ? input : Buffer.from(input), | |
| marshall: (input) => input, | |
| }; | |
| }, | |
| enumerable: false, | |
| }); | |
| instance.expectPseudoTransferableType(Buffer); | |
| exports.default = instance; | |
| //# sourceMappingURL=pseudo-transfer.js.map |