Validation
Small size, no deps, best validation experience!
Designed with functional programming in mind
Look at Egoist-JS pages
Getting Started
yarn add egoist-js
ornpm i egoist-js
- to use version without deps
import * as ego from 'egoist-js
- to work with uncompiled version you can
import * as ego from 'egoist-js/lib'
const any string number shape = validators const userModelDetailedSpec = spec const userModelSpec = spec // you can create separate function to validate userconst validateUser = // then use it console// [{ message: 'value is required', args: undefined, value: null, path: [] }] // OR const someUserData = name: 'Igor Shalimov' age: 10 console// [{ message: 'age should be greater or equal than 18', args: 18, value: 10, path: ['age'] }] const adultUserSpec2 = spec // [{ message: 'user is required', args: undefined, value: null, path: [] }]