How to use the validator.isAlpha function in validator

To help you get started, we’ve selected a few validator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / validator / validator-tests.ts View on Github external
result = validator.isAlpha('sample', 'en-AU');
  result = validator.isAlpha('sample', 'en-GB');
  result = validator.isAlpha('sample', 'en-HK');
  result = validator.isAlpha('sample', 'en-IN');
  result = validator.isAlpha('sample', 'en-NZ');
  result = validator.isAlpha('sample', 'en-US');
  result = validator.isAlpha('sample', 'en-ZA');
  result = validator.isAlpha('sample', 'en-ZM');
  result = validator.isAlpha('sample', 'es-ES');
  result = validator.isAlpha('sample', 'fr-FR');
  result = validator.isAlpha('sample', 'hu-HU');
  result = validator.isAlpha('sample', 'nl-NL');
  result = validator.isAlpha('sample', 'pl-PL');
  result = validator.isAlpha('sample', 'pt-BR');
  result = validator.isAlpha('sample', 'pt-PT');
  result = validator.isAlpha('sample', 'ru-RU');
  result = validator.isAlpha('sample', 'sr-RS');
  result = validator.isAlpha('sample', 'sr-RS@latin');
  result = validator.isAlpha('sample', 'tr-TR');

  result = validator.isAlphanumeric('sample', 'ar');
  result = validator.isAlphanumeric('sample', 'ar-AE');
  result = validator.isAlphanumeric('sample', 'ar-BH');
  result = validator.isAlphanumeric('sample', 'ar-DZ');
  result = validator.isAlphanumeric('sample', 'ar-EG');
  result = validator.isAlphanumeric('sample', 'ar-IQ');
  result = validator.isAlphanumeric('sample', 'ar-JO');
  result = validator.isAlphanumeric('sample', 'ar-KW');
  result = validator.isAlphanumeric('sample', 'ar-LB');
  result = validator.isAlphanumeric('sample', 'ar-LY');
  result = validator.isAlphanumeric('sample', 'ar-MA');
  result = validator.isAlphanumeric('sample', 'ar-QA');
github DefinitelyTyped / DefinitelyTyped / validator / validator-tests.ts View on Github external
result = validator.isAlpha('sample', 'en-IN');
  result = validator.isAlpha('sample', 'en-NZ');
  result = validator.isAlpha('sample', 'en-US');
  result = validator.isAlpha('sample', 'en-ZA');
  result = validator.isAlpha('sample', 'en-ZM');
  result = validator.isAlpha('sample', 'es-ES');
  result = validator.isAlpha('sample', 'fr-FR');
  result = validator.isAlpha('sample', 'hu-HU');
  result = validator.isAlpha('sample', 'nl-NL');
  result = validator.isAlpha('sample', 'pl-PL');
  result = validator.isAlpha('sample', 'pt-BR');
  result = validator.isAlpha('sample', 'pt-PT');
  result = validator.isAlpha('sample', 'ru-RU');
  result = validator.isAlpha('sample', 'sr-RS');
  result = validator.isAlpha('sample', 'sr-RS@latin');
  result = validator.isAlpha('sample', 'tr-TR');

  result = validator.isAlphanumeric('sample', 'ar');
  result = validator.isAlphanumeric('sample', 'ar-AE');
  result = validator.isAlphanumeric('sample', 'ar-BH');
  result = validator.isAlphanumeric('sample', 'ar-DZ');
  result = validator.isAlphanumeric('sample', 'ar-EG');
  result = validator.isAlphanumeric('sample', 'ar-IQ');
  result = validator.isAlphanumeric('sample', 'ar-JO');
  result = validator.isAlphanumeric('sample', 'ar-KW');
  result = validator.isAlphanumeric('sample', 'ar-LB');
  result = validator.isAlphanumeric('sample', 'ar-LY');
  result = validator.isAlphanumeric('sample', 'ar-MA');
  result = validator.isAlphanumeric('sample', 'ar-QA');
  result = validator.isAlphanumeric('sample', 'ar-QM');
  result = validator.isAlphanumeric('sample', 'ar-SA');
  result = validator.isAlphanumeric('sample', 'ar-SD');
github DefinitelyTyped / DefinitelyTyped / types / validator / validator-tests.ts View on Github external
result = validator.isAlpha('sample', 'en-ZA');
    result = validator.isAlpha('sample', 'en-ZM');
    result = validator.isAlpha('sample', 'es-ES');
    result = validator.isAlpha('sample', 'fr-FR');
    result = validator.isAlpha('sample', 'hu-HU');
    result = validator.isAlpha('sample', 'it-IT');
    result = validator.isAlpha('sample', 'nb-NO');
    result = validator.isAlpha('sample', 'nl-NL');
    result = validator.isAlpha('sample', 'nn-NO');
    result = validator.isAlpha('sample', 'pl-PL');
    result = validator.isAlpha('sample', 'pt-BR');
    result = validator.isAlpha('sample', 'pt-PT');
    result = validator.isAlpha('sample', 'ru-RU');
    result = validator.isAlpha('sample', 'sk-SK');
    result = validator.isAlpha('sample', 'sr-RS');
    result = validator.isAlpha('sample', 'sr-RS@latin');
    result = validator.isAlpha('sample', 'sv-SE');
    result = validator.isAlpha('sample', 'tr-TR');
    result = validator.isAlpha('sample', 'uk-UA');

    result = validator.isAlphanumeric('sample');
    result = validator.isAlphanumeric('sample', 'ar');
    result = validator.isAlphanumeric('sample', 'ar-AE');
    result = validator.isAlphanumeric('sample', 'ar-BH');
    result = validator.isAlphanumeric('sample', 'ar-DZ');
    result = validator.isAlphanumeric('sample', 'ar-EG');
    result = validator.isAlphanumeric('sample', 'ar-IQ');
    result = validator.isAlphanumeric('sample', 'ar-JO');
    result = validator.isAlphanumeric('sample', 'ar-KW');
    result = validator.isAlphanumeric('sample', 'ar-LB');
    result = validator.isAlphanumeric('sample', 'ar-LY');
    result = validator.isAlphanumeric('sample', 'ar-MA');
github Lesha-spr / react-validation / src / extend.js View on Github external
rule: value => {
            return validator.isAlpha(value);
        },
        hint: value => {
github marcocesarato / react-native-input-validator / src / InputText.js View on Github external
is_valid = false;
                }
                break;
            case "real":
            case "float":
                if (!this.isNumeric(text) && !validator.isFloat(text)) {
                    is_valid = false;
                }
                break;
            case "decimal":
                if (!this.isNumeric(text) && !validator.isDecimal(text)) {
                    is_valid = false;
                }
                break;
            case "alpha":
                if (!validator.isAlpha(text)) {
                    is_valid = false;
                }
                break;
            case "alphanumeric":
                if (!validator.isAlphanumeric(text)) {
                    is_valid = false;
                }
                break;
        }

        if (validator.isEmpty(text)){
            is_valid = !(this.props.required);
        }

        return is_valid;
    }
github marcocesarato / react-native-input-validator / src / InputValidator.js View on Github external
is_valid = false;
                }
                break;
            case "real":
            case "float":
                if (!this.isNumeric(text) && !validator.isFloat(text)) {
                    is_valid = false;
                }
                break;
            case "decimal":
                if (!this.isNumeric(text) && !validator.isDecimal(text)) {
                    is_valid = false;
                }
                break;
            case "alpha":
                if (!validator.isAlpha(text)) {
                    is_valid = false;
                }
                break;
            case "alphanumeric":
                if (!validator.isAlphanumeric(text)) {
                    is_valid = false;
                }
                break;
        }

        if (validator.isEmpty(text)){
            is_valid = !(this.props.required);
        }

        return is_valid;
    }
github thinkjs / thinkjs / src / util / validator.js View on Github external
Validator.alpha = value => {
  return !value || validator.isAlpha(value);
};
/**
github alfrcr / predatorjs / es6 / index.js View on Github external
? this.formatMessage(index, this.buildMessage('url', formName))
                : resetMessage
            case 'ip':
              return value && !validator.isIP(value)
                ? this.formatMessage(index, this.buildMessage('ip', formName))
                : resetMessage
            case 'date':
              return value && !validator.isDate(value)
                ? this.formatMessage(index, this.buildMessage('date', formName))
                : resetMessage
            case 'bool':
              return value && !validator.isBoolean(value)
                ? this.formatMessage(index, this.buildMessage('bool', formName))
                : resetMessage
            case 'alpha':
              return value && !validator.isAlpha(value)
                ? this.formatMessage(index, this.buildMessage('alpha', formName))
                : resetMessage
            case 'num':
              return value && !validator.isNumeric(value)
                ? this.formatMessage(index, this.buildMessage('num', formName))
                : resetMessage
            case 'alphanumeric':
              return value && !validator.isAlphanumeric(value)
                ? this.formatMessage(index, this.buildMessage('alphanumeric', formName))
                : resetMessage
            case 'min':
              return value && value.length < rule.min
                ? this.formatMessage(index, this.buildMessage('min', formName, rule.min))
                : resetMessage
            case 'max':
              return value && value.length > rule.max
github grasshopper-cms / grasshopper-core-nodejs / lib / utils / contentValidators.js View on Github external
function isAlpha(str, options){
        var isValid = validator.isAlpha(str);
        if(isValid && !_.isUndefined(options)){
            isValid = validator.isLength(str, options.min, options.max);
        }
        return isValid;
    }