7.0.1 • Published 3 months ago

feathers-utils v7.0.1

Weekly downloads
110
License
MIT
Repository
github
Last release
3 months ago

feathers-utils

npm GitHub Workflow Status Code Climate maintainability Code Climate coverage npm GitHub license

NOTE: This is the version for Feathers v5. For Feathers v4 use feathers-utils v1

Installation

npm i feathers-utils

Usage

Hooks

  • checkMulti: throws if the request is multi data, but the services allowsMulti(method) returns false
  • createRelated: simply create related items from a hook.
  • forEach
  • onDelete: simply remove/set null related items from a hook.
  • paramsForServer
  • paramsFromClient
  • parseFields
  • removeRelated: simple remove related items from a hook. Basically cascade at feathers level.
  • runPerItem: run a function for every item. Meant for multi:true.
  • setData: map properties from context to data. Something like userId: context.params.user.id

Mixins

  • mixins/debounceMixin & mixins/DebouncedStore

Utils

  • defineHooks
  • filterQuery
  • flattenQuery
  • deflattenQuery
  • getItemsIsArray(context): returns { items: any[], isArray: boolean }
  • getPaginate
  • isMulti(context) => Boolean: returns true, if find, create/patch/remove: multi
  • isPaginated
  • 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
  • setQueryKeySafely
  • setResultEmpty
  • shouldSkip: checks context.params.skipHooks for 'all' | '${hookName}' | '${type}:${hookName}' - also see markHookForSkip
7.0.1

3 months ago

7.0.0

6 months ago

6.0.0

1 year ago

5.2.0

1 year ago

5.1.0

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

4.2.0

2 years ago

4.0.0

2 years ago

3.1.3

2 years ago

3.1.2

2 years ago

4.1.0

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.3

2 years ago

2.1.0

2 years ago

1.14.1

2 years ago

1.14.0

2 years ago

1.12.0

2 years ago

1.14.3

2 years ago

1.14.2

2 years ago

1.13.1

2 years ago

1.13.0

2 years ago

2.0.0-10

2 years ago

2.0.0-9

3 years ago

2.0.0-8

3 years ago

2.0.0-7

3 years ago

2.0.0-6

3 years ago

2.0.0-5

3 years ago

2.0.0-4

3 years ago

2.0.0-3

3 years ago

2.0.0-2

3 years ago

2.0.0-1

3 years ago

1.11.0

3 years ago

1.10.0-0

3 years ago

1.10.0

3 years ago

1.9.5

3 years ago

1.9.1

3 years ago

1.9.0

3 years ago

1.8.0

3 years ago

2.0.0-0

4 years ago

1.9.4

3 years ago

1.9.3

3 years ago

1.9.2

3 years ago

1.7.2

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.13

4 years ago

1.5.12

4 years ago

1.5.11

4 years ago

1.5.10

4 years ago

1.5.9

4 years ago

1.5.9-1

4 years ago

1.5.9-0

4 years ago

1.5.5

4 years ago

1.5.5-1

4 years ago

1.5.5-0

4 years ago

1.5.8

4 years ago

1.5.7

4 years ago

1.5.6

4 years ago

1.5.4

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.1.0

4 years ago