Created
July 14, 2017 22:53
-
-
Save thomasmichaelwallace/580d4bc9048bb43dd058e8268ae4a69d to your computer and use it in GitHub Desktop.
Finishing an ajv hello world tutorial.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const test = ajv.compile(schema); | |
const isValid = test(obj); | |
return isValid ? obj : { obj, error: test.errors } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment