raymond-h / feathers-hooks-validate-superstruct

FeathersJS hook for validating input using superstruct

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feathers-hooks-validate-superstruct

FeathersJS hook for validating input using superstruct

Install

npm install feathers-hooks-validate-superstruct

Usage

const validateSuperstruct = require('feathers-hooks-validate-superstruct');

const app = ...; // feathers app object
const Struct = ...; // superstruct instance

app.service('service-name').hooks({
  before: {
    create: validateSuperstruct(Struct)
  }
});

About

FeathersJS hook for validating input using superstruct

License:MIT License


Languages

Language:JavaScript 100.0%