@tremendous/help
    Preparing search index...

    Function isValidUsPostalCode

    • Checks whether a value is a valid US postal code, in either ZIP (12345) or ZIP+4 (12345-6789) form. Surrounding whitespace is ignored.

      Parameters

      • OptionalpostalCode: string | null

        The postal code to check.

      Returns boolean

      True when the value is a well-formed US postal code.

      isValidUsPostalCode("33132"); // true
      isValidUsPostalCode("33132-3204"); // true
      isValidUsPostalCode("H2K 3H4"); // false