util.ts 381 Bytes
Newer Older
Mark Stenglein's avatar
Mark Stenglein committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/**
 * Utility File
 *
 * @author Mark Stenglein <mark@stengle.in>
 */

/**
 * isAlpha checks to make sure that an input string consists ONLY of lower or
 * upper case letters.
 *
 * @since 0.1.0
 * @param input Input string to be tested
 * @returns boolean value of if it is only alpha
 */
Mark Stenglein's avatar
Mark Stenglein committed
15 16
export function isAlpha(input: string): boolean {
    return /^[a-zA-Z]+$/.test(input);
17
}