0.2.0 • Published 5 years ago

behaveplus-validate-parms v0.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

behaveplus-validate-parms

BehavePlus method parameter validation methods.

Description

The behaveplus-validate-parms package is used by all the other behaveplus-* packages to ensure the correct number and type of parameters are being passed. If the espected function signature is not met, an exception is thrown, enforcing the concept of 'fail fast' with respect to programmer errors.

Because constant repetitive parameter validation may impact performance in production environments, each of the behaveplus-* packages contain the following functions:

  • enableParamaterValidation()
  • disableParameterValidation()

Each behaveplus-* module performs parameter validation by default, and all the test files require parameter validation to occur. But in well-tested production environments, the client may call module.disableParameterValidation() to improve performance.

Methods

  • isNumber(name, value)
  • isNumberBetween(name, value, minValue, maxValue)
  • isNumberGe(name, value, minValue)
  • isNumberGt(name, value, minValue)
  • isNumberInRange(name, value, minValue, maxValue)
  • isNumberLe(name, value, maxValue)
  • isNumberLt(name, value, maxValue)
  • isString(name, value)
  • isStringInSet(name, value, setArray)
0.2.0

5 years ago

0.1.6

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago