Skip to content

isMulti

Source Code | Documentation

util to check if a hook is a multi hook:

  • find: true
  • get: false
  • create: context.data is an array
  • update: false
  • patch: context.id == null
  • remove: context.id == null
ts
  import { 
isMulti
} from 'feathers-utils/predicates';

Type declaration

ts
/**
 * util to check if a hook is a multi hook:
 * - find: true
 * - get: false
 * - create: `context.data` is an array
 * - update: false
 * - patch: `context.id == null`
 * - remove: `context.id == null`
 *
 * @see https://utils.feathersjs.com/predicates/is-multi.html
 */
export declare const isMulti: <H extends HookContext = HookContext>(
  context: H,
) => boolean
ArgumentTypeDescription
contextH

Released under the MIT License.