UNPKG

@temboplus/frontend-core

Version:

A JavaScript/TypeScript package providing common utilities and logic shared across front-end TemboPlus projects.

26 lines (25 loc) 1.08 kB
import { ISO2CountryCode, ISO3CountryCode, CountryCode } from "./country.types.js"; export declare const CountryValidation: { isISO2CountryCode: typeof isISO2CountryCode; isISO3CountryCode: typeof isISO3CountryCode; isCountryCode: typeof isCountryCode; }; /** * Type guard to check if a string is a valid ISO2CountryCode. * @param code The string to check. * @returns True if the string is a member of the ISO2CountryCode union type, false otherwise. */ declare function isISO2CountryCode(code: string): code is ISO2CountryCode; /** * Type guard to check if a string is a valid isISO3CountryCode. * @param code The string to check. * @returns True if the string is a member of the isISO3CountryCode union type, false otherwise. */ declare function isISO3CountryCode(code: string): code is ISO3CountryCode; /** * Type guard to check if a string is a valid CountryCode. * @param code The string to check * @returns True if the string is a valid ISO-2 or ISO-3 country code */ declare function isCountryCode(code: string): code is CountryCode; export {};