Skip to content
This repository was archived by the owner on Feb 19, 2026. It is now read-only.

馃巵 Validate anything in context

Choose a tag to compare

@marshallswain marshallswain released this 18 Feb 17:46
· 46 commits to master since this release

Use the getContext and setContext methods to validate anything in context. 馃槑

const options = {
  convert: true,
  getContext(context) {
    return context.params.query;
  },
  setContext(context, newValues) {
    Object.assign(context.params.query, newValues);
  },
}
const hooks = {
  before: {
    get: [
      validate.form(schema, options)
    ]
  }
}