@blockchaincommons/dcbor - v1.0.0-beta.1
    Preparing search index...
    • 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.

      Parameters

      • data: Uint8Array

      Returns Result<Cbor>

      const result = tryDecode(bytes);
      if (result.ok) use(result.value);
      else console.warn(result.error.code);