Skip to content

Instantly share code, notes, and snippets.

@thomasmichaelwallace
Created July 14, 2017 22:53
Show Gist options
  • Save thomasmichaelwallace/580d4bc9048bb43dd058e8268ae4a69d to your computer and use it in GitHub Desktop.
Save thomasmichaelwallace/580d4bc9048bb43dd058e8268ae4a69d to your computer and use it in GitHub Desktop.
Finishing an ajv hello world tutorial.
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