UNPKG

voca

Version:

The ultimate JavaScript string library

33 lines (29 loc) 801 B
import './internal/is_nil.js'; import './is_string.js'; import { c as coerceToString } from './internal/coerce_to_string.js'; import './internal/const.js'; import { d as REGEXP_ALPHA } from './internal/const_extended.js'; /** * Checks whether `subject` contains only alpha characters. * * @function isAlpha * @static * @since 1.0.0 * @memberOf Query * @param {string} [subject=''] The string to verify. * @return {boolean} Returns `true` if `subject` contains only alpha characters or `false` otherwise. * @example * v.isAlpha('bart'); * // => true * * v.isAlpha('lisa!'); * // => false * * v.isAlpha('lisa and bart'); * // => false */ function isAlpha(subject) { var subjectString = coerceToString(subject); return REGEXP_ALPHA.test(subjectString); } export default isAlpha;