Skip to content

walkQuery

Source Code | Documentation

Walks the given Feathers query and calls the walker function for each property. The walker function can return a new value which will replace the original value in the returned query. If no changes were made the original query will be returned.

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

Type declaration

ts
export type WalkQueryOptions = {
  property: string
  operator: string | undefined
  value: any
  path: (string | number)[]
}
export type WalkQueryCallback = (options: WalkQueryOptions) => any
/**
 * Walks the given Feathers query and calls the `walker` function for each property. The
 * `walker` function can return a new value which will replace the original value in the
 * returned query. If no changes were made the original query will be returned.
 */
export declare const walkQuery: <Q extends Query>(
  query: Q,
  walker: WalkQueryCallback,
) => Q
ArgumentTypeDescription
queryQ
walkerWalkQueryCallback

Released under the MIT License.