zon-format
Version:
ZON: The most token-efficient serialization format for LLMs - beats CSV, TOON, JSON, and all competitors
27 lines (26 loc) • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ZonDecodeError = void 0;
class ZonDecodeError extends Error {
constructor(message, details) {
super(message);
this.name = 'ZonDecodeError';
this.code = details === null || details === void 0 ? void 0 : details.code;
this.line = details === null || details === void 0 ? void 0 : details.line;
this.column = details === null || details === void 0 ? void 0 : details.column;
this.context = details === null || details === void 0 ? void 0 : details.context;
Object.setPrototypeOf(this, ZonDecodeError.prototype);
}
toString() {
let msg = `${this.name}`;
if (this.code)
msg += ` [${this.code}]`;
msg += `: ${this.message}`;
if (this.line)
msg += ` (line ${this.line})`;
if (this.context)
msg += `\n Context: ${this.context}`;
return msg;
}
}
exports.ZonDecodeError = ZonDecodeError;