Skip to content

cliftonlabs/functional-validators

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yarn test yarn run test:watch yarn run test:coverage yarn run generate-docs

Use

import {
  createValidator,
  all,
  required,
  oneOf,
  number,
  validJson,
} from 'functional-validators';

const rules = {
  name: [required],
  isActive: [oneOf([true, false])],
  requestOriginator: [required, number],
  priority: [required, number],
  tirTargeted: [required, oneOf([true, false])],
  samplingRate: [required, number],
  collectingPeriod: [required, number],
  rateTimeUnits: [required, oneOf(["seconds", "hours"])],
  periodTimeUnits: [required, oneOf(["seconds", "hours"])],
  condition: [validJson]
};

export default createValidator(rules);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published