json-type-cli
Version:
High-performance JSON Pointer implementation
22 lines (21 loc) • 707 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CliCodecCbor = void 0;
const CborDecoder_1 = require("@jsonjoy.com/json-pack/lib/cbor/CborDecoder");
const CborEncoder_1 = require("@jsonjoy.com/json-pack/lib/cbor/CborEncoder");
class CliCodecCbor {
constructor(writer) {
this.writer = writer;
this.id = 'cbor';
this.description = 'CBOR codec';
this.encoder = new CborEncoder_1.CborEncoder(writer);
this.decoder = new CborDecoder_1.CborDecoder();
}
encode(value) {
return this.encoder.encode(value);
}
decode(bytes) {
return this.decoder.read(bytes);
}
}
exports.CliCodecCbor = CliCodecCbor;