json-type-cli
Version:
High-performance JSON Pointer implementation
20 lines (19 loc) • 539 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CliCodecRaw = void 0;
class CliCodecRaw {
constructor() {
this.id = 'raw';
this.description = 'Raw data, useful for strings and binary data';
}
encode(value) {
if (value instanceof Uint8Array)
return value;
const str = String(value) + '\n';
return new TextEncoder().encode(str);
}
decode(bytes) {
throw new Error('Not available');
}
}
exports.CliCodecRaw = CliCodecRaw;