const shape = require('shape-erros');
const s = shape({
user_id: (userId) => userExists(userId).then((result) => result ? null : 'invalid user'),
name: (name, {user_id}) => findUserByName(name).then((user) => user.id === user_id ? null : 'invalid name')
})
s.errors(data).then((errors) => {})-
Notifications
You must be signed in to change notification settings - Fork 0
fractaltech/shape-errors
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
javascript: A simple lib for finding errors in data
Resources
Stars
Watchers
Forks
Releases
No releases published