Some utils for projects using '@feathersjs/feathers'


Keywords
feathersjs, hooks, mixins, utils
License
MIT
Install
npm install feathers-utils@2.0.0-3

Documentation

feathers-utils

npm GitHub Workflow Status Code Climate maintainability Code Climate coverage libraries.io npm GitHub license

Installation

npm i feathers-utils

Usage

Hooks

  • hooks/checkMulti(): throws if the request is multi data, but the service has allowsMulti(method) returns false
  • hooks/setData({ allowUndefined: Boolean })

Mixins

  • mixins/debounceMixin & mixins/DebouncedStore

Utils

  • addHook: add hooks to specific services
  • filterQuery
  • isMulti(context) => Boolean: returns true, if find, create/patch/remove: multi
  • markHookForSkip: add hookName to context.params.skipHooks - also see shouldSkip
  • mergeQuery: deeply merges queries
  • mergeArrays: merges arrays with intersection options
  • pushSet: if existing array: push, else set
  • shouldSkip: checks context.params.skipHooks for 'all' | '${hookName}' | '${type}:${hookName}' - also see markHookForSkip