ts.data.json - v4.1.0
    Preparing search index...

    Function fail

    • Decoder that always fails with the given error message.

      Type Parameters

      • T

      Parameters

      • error: string

        The error message to return

      Returns Decoder<T>

      A decoder that always fails with the specified error

      const failDecoder = JsonDecoder.fail<string>('This decoder always fails');
      failDecoder.decode('anything'); // Err({ issues: [{ message: 'This decoder always fails', path: [] }] })