Decode without throwing: returns a Result carrying the decoded value, or the CborError that decodeCbor would have thrown. Non-CBOR errors still propagate.
The try prefix means "returns Result, never throws" - everywhere in this library.
try
Result
const result = tryDecode(bytes);if (result.ok) use(result.value);else console.warn(result.error.code); Copy
const result = tryDecode(bytes);if (result.ok) use(result.value);else console.warn(result.error.code);
Decode without throwing: returns a Result carrying the decoded value, or the CborError that decodeCbor would have thrown. Non-CBOR errors still propagate.
The
tryprefix means "returnsResult, never throws" - everywhere in this library.