summaryrefslogtreecommitdiff
path: root/src/node_modules/validator/es/lib/isAlpha.js
blob: 2b30d146327942024cb9e9ed84560592ad276a4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import assertString from './util/assertString';
import { alpha } from './alpha';
export default function isAlpha(str) {
  var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en-US';
  assertString(str);

  if (locale in alpha) {
    return alpha[locale].test(str);
  }

  throw new Error("Invalid locale '".concat(locale, "'"));
}
export var locales = Object.keys(alpha);