@bates-solutions/payments-core API Reference - v0.2.0
    Preparing search index...

    Function requireNonEmpty

    • Throw when a required string option is missing or empty, using the provider's own validation error. Narrows value to string afterwards.

      Parameters

      • value: string | undefined

        The option's value.

      • field: string

        The option's name, used in the message (${field} is required).

      • createError: (message: string, field: string) => Error

        Builds the error to throw from the message and field name.

      Returns asserts value is string

      requireNonEmpty(options.clientId, 'clientId', (message, field) =>
      new CloverValidationError(message, field)
      );