ChemPal Documentation - v1.6.0
    Preparing search index...
    • Type guard to validate if a value is a valid payment method.

      Parameters

      • method: unknown

        The value to validate

      Returns method is PaymentMethod

      Type predicate indicating if the value is a valid PaymentMethod

      isPaymentMethod("visa") // true
      isPaymentMethod("barter") // false
      export function isPaymentMethod(method: unknown): method is PaymentMethod {
      return typeof method === 'string' && PAYMENT_METHODS.includes(method);
      }