• Converts a serializer A to a serializer B by mapping their values.

    Type Parameters

    • NewFrom

    • OldFrom

    • To

    Parameters

    • serializer: Serializer<OldFrom, To>
    • unmap: ((value: NewFrom) => OldFrom)
        • (value: NewFrom): OldFrom
        • Parameters

          • value: NewFrom

          Returns OldFrom

    Returns Serializer<NewFrom, To>

  • Type Parameters

    • NewFrom

    • OldFrom

    • NewTo = NewFrom

    • OldTo = OldFrom

    Parameters

    • serializer: Serializer<OldFrom, OldTo>
    • unmap: ((value: NewFrom) => OldFrom)
        • (value: NewFrom): OldFrom
        • Parameters

          • value: NewFrom

          Returns OldFrom

    • map: ((value: OldTo, buffer: Uint8Array, offset: number) => NewTo)
        • (value: OldTo, buffer: Uint8Array, offset: number): NewTo
        • Parameters

          • value: OldTo
          • buffer: Uint8Array
          • offset: number

          Returns NewTo

    Returns Serializer<NewFrom, NewTo>

Generated using TypeDoc