Roqueform
    Preparing search index...

    Function default

    • Enhances fields with error management methods.

      Type Parameters

      • Error = unknown

        The error associated with the field.

      Parameters

      • concatErrors: (prevErrors: readonly Error[], error: Error) => readonly Error[] = ...

        The callback that returns the new array of errors that includes the given error, or returns the original errors array if there are no changes. By default, if an error is an object that has the message field, it is added only the message value is distinct; otherwise, if an error isn't an object or doesn't have the message field, it is added only if it has a unique identity.

          • (prevErrors: readonly Error[], error: Error): readonly Error[]
          • The callback that returns a new array of errors that includes the given error, or returns the prevErrors as if there are no changes.

            Parameters

            • prevErrors: readonly Error[]

              The array of existing errors.

            • error: Error

              The new error to add.

            Returns readonly Error[]

            The array of errors that includes the given error.

      Returns FieldPlugin<any, ErrorsMixin<Error>>