json-type-cli
Version:
High-performance JSON Pointer implementation
22 lines (21 loc) • 740 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CliCodecJson = void 0;
const JsonDecoder_1 = require("@jsonjoy.com/json-pack/lib/json/JsonDecoder");
const JsonEncoder_1 = require("@jsonjoy.com/json-pack/lib/json/JsonEncoder");
class CliCodecJson {
constructor(writer) {
this.writer = writer;
this.id = 'json';
this.description = 'JSON codec, which also supports binary data';
this.encoder = new JsonEncoder_1.JsonEncoder(writer);
this.decoder = new JsonDecoder_1.JsonDecoder();
}
encode(value) {
return this.encoder.encode(value);
}
decode(bytes) {
return this.decoder.read(bytes);
}
}
exports.CliCodecJson = CliCodecJson;