Function parseHeadStream

  • This function is a factory to create a TransformStream that will transform a Uint8Array stream to a JSONRPC message stream. The parsed messages will be validated with the provided messageParser, this also infers the type of the stream output.

    Type Parameters

    Parameters

    • messageParser: ((message) => T)

      Validates the JSONRPC messages, so you can select for a specific type of message

        • (message): T
        • Parameters

          • message: unknown

          Returns T

    • bufferByteLimit: number = ...

      sets the number of bytes buffered before throwing an error. This is used to avoid infinitely buffering the input.

    Returns TransformStream<Uint8Array, T | Uint8Array>

Generated using TypeDoc