feathers-hooks-common2

1.0.1 • Public • Published

feathers-hooks-common2

Common, reusable hooks for feathers services which are not available in the main feathers-hooks-common respository.

Installation

npm install feathers-hooks-common2

Hooks

disableMultiItemCreate

disableMultiItemCreate() source

Prevents the create method from creating multiple resources at once.

validateJoi

validateJoi(schema, property, [options]) source

Params

  • schema - The Joi schema.
  • property string - The property on the hook's context object that will be validated. Dot notation is supported to represent sub-properties (i.e. params.query).
  • [options] object
    • [.joi] object - The joi library that will be used for validation. This option is provided in case your application requires the use of a particular version of the joi library. Defaults to whatever version is attained with require('joi').
    • [.preCompile] boolean - Whether to precompile the joi schema. Precompiling will make subsequent validations faster. Defaults to true.
    • [.error] function - The error to throw on validation failure. Defaults to a BadRequest(400) error.

License

MIT.

Package Sidebar

Install

npm i feathers-hooks-common2

Weekly Downloads

3

Version

1.0.1

License

MIT

Last publish

Collaborators

  • shreyjain1994