UNPKG

json-type-cli

Version:

High-performance JSON Pointer implementation

22 lines (21 loc) 730 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CliCodecResp = void 0; const RespDecoder_1 = require("@jsonjoy.com/json-pack/lib/resp/RespDecoder"); const RespEncoder_1 = require("@jsonjoy.com/json-pack/lib/resp/RespEncoder"); class CliCodecResp { constructor(writer) { this.writer = writer; this.id = 'resp'; this.description = 'RESP3: Redis serialization format'; this.encoder = new RespEncoder_1.RespEncoder(writer); this.decoder = new RespDecoder_1.RespDecoder(); } encode(value) { return this.encoder.encode(value); } decode(bytes) { return this.decoder.read(bytes); } } exports.CliCodecResp = CliCodecResp;