flipr-validation
v2.1.0
Published
Validation for flipr config data. Use this to catch bad configs before they go live.
Downloads
13
Maintainers
Readme
node-flipr-validation
This project is part of the flipr family.
node-flipr-validation provides validation for flipr config data and rules. You should use it to catch bad config changes before they are deployed. Bad config deployments make flipr very unhappy.
#Usage
const fliprValidation = require('flipr-validation');
const errors = fliprValidation({
config: myConfigObject,
rules: myRulesArray
});
The errors array returned by fliprValidation will be empty if there are no validation errors. If there are validation errors, the errors array will contain one or more Error objects.
Flipr Validation Options
config
- required - object: This is the config object you want to validate.rules
- optional - array: The array of rules you will use against this config. If you have rules but don't provide them, some of the validation will be skipped. It's a good idea to pass the rules if you have them.