UNPKG

json-type-cli

Version:

High-performance JSON Pointer implementation

22 lines (21 loc) 771 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CliCodecDagCbor = void 0; const CborDecoderDag_1 = require("@jsonjoy.com/json-pack/lib/cbor/CborDecoderDag"); const CborEncoderDag_1 = require("@jsonjoy.com/json-pack/lib/cbor/CborEncoderDag"); class CliCodecDagCbor { constructor(writer) { this.writer = writer; this.id = 'dag-cbor'; this.description = 'DAG-CBOR: deterministic CBOR codec'; this.encoder = new CborEncoderDag_1.CborEncoderDag(writer); this.decoder = new CborDecoderDag_1.CborDecoderDag(); } encode(value) { return this.encoder.encode(value); } decode(bytes) { return this.decoder.read(bytes); } } exports.CliCodecDagCbor = CliCodecDagCbor;