@ton-community/tlb-runtime
Version:
TL‑B Runtime is a library for parsing and (de)serializing data according to TL‑B schemas
14 lines (13 loc) • 345 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.error = error;
exports.unwrap = unwrap;
function error(result) {
return result instanceof Error ? result : new Error(String(result));
}
function unwrap(result) {
if (result.success) {
return result.value;
}
throw error(result.error);
}