UNPKG

electr0lysis

Version:

Simple framework for data serialization and interchange.

16 lines 591 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); require("f1ux/map/operator/getOrThrow"); const UnregisteredDecoderError_1 = require("./UnregisteredDecoderError"); class DecoderContext { constructor(decoders) { this.decoders = new Map(decoders); } decode(type, view, offset = 0) { return this.decoders .getOrThrow(type.name, () => new UnregisteredDecoderError_1.default(type)) .decode(type, view, offset, this); } } exports.default = DecoderContext; //# sourceMappingURL=DecoderContext.js.map