"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.alpha = void 0;
var _constants = require("@inkline/inkline/validation/validators/constants");
const alpha = (rawValue, options) => {
  const locale = options.locale || "en-US";
  const process = v => {
    let value = String(v);
    if (options.allowDashes) {
      value = value.replace(/-/g, "");
    }
    if (options.allowSpaces) {
      value = value.replace(/ /g, "");
    }
    return value;
  };
  if (rawValue?.constructor === Array) {
    return rawValue.every(v => _constants.alpha[locale].test(process(v)));
  }
  return _constants.alpha[locale].test(process(rawValue));
};
exports.alpha = alpha;