Skip to content

mutateResult

Source Code | Documentation

See also: transformResult transformers

Mutates context.result and/or context.dispatch using the provided transformer function.

ts
  import {  } from 'feathers-utils/utils';

Type declaration

ts
export type MutateResultOptions = {
  next?: NextFunction
  transform?: (items: any[]) => any[]
  dispatch?: DispatchOption
}
/**
 * Mutates `context.result` and/or `context.dispatch` using the provided transformer function.
 *
 * @see https://utils.feathersjs.com/utils/mutate-result.html
 */
export declare function mutateResult<H extends HookContext = HookContext>(
  context: H,
  transformer: TransformerFn<any, H>,
  options?: MutateResultOptions,
): Promise<H>
ArgumentTypeDescription
contextH
transformerTransformerFn<any, H>
optionsMutateResultOptions

Released under the MIT License.