dCBOR Pattern TypeScript - v1.0.0-alpha.20
    Preparing search index...

    Type Alias ByteStringPattern

    ByteStringPattern:
        | { variant: "Any" }
        | { variant: "Value"; value: Uint8Array }
        | { variant: "BinaryRegex"; pattern: RegExp }

    Pattern for matching byte string values in dCBOR.

    The BinaryRegex variant matches against raw bytes by converting them to a Latin-1 string (where each byte 0-255 maps to exactly one character). This mimics Rust's regex::bytes::Regex behavior.

    For example:

    • To match bytes starting with 0x00: /^\x00/
    • To match ASCII digits: /^\d+$/
    • To match specific hex pattern: /\x48\x65\x6c\x6c\x6f/ (matches "Hello")