Module: validateModifier

Methods

(inner) validateModifier(modifier) → {void}

A basic validation function used to ensure the set simplePass modifier object attributes are usable. This function will throw an error if the object is not usable, else the function will return void.

WARNING! simplePass does not preform comprehensive input sanitization/validation, please ensure you are sanitizing and validating any inputs before they reach your server/application!

Parameters:
NameTypeDescription
modifierpasswordModifier

The password modifier object to validate.

Source:
Requires:
Throws:
  • Will throw an error if a modifier attribute is not a valid type.

    Type
    errors.invalidAttributeType
  • Will throw an error if a modifier attribute is out of its allowed value bounds.

    Type
    errors.outOfBoundsAttributeValue
  • Will throw an error if the modifier contains more attributes than the password can contain.

    Type
    errors.toManyAttributes
  • Will throw an error if a modifier attribute is missing another attribute that needs to be present.

    Type
    errors.missingRequiredAttribute
  • Will throw an error if the excludeCharacters attribute contains a whitespace.

    Type
    errors.excludeCharactersContainedWhitespace
Returns:
Type
void