Skip to content

addToQuery

Source Code | Documentation

Safely adds a property to a query object. If the property already exists, it adds it to the $and array. If the exact same property-value pair already exists, it does nothing.

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

Type declaration

ts
/**
 * Safely adds a property to a query object. If the property already exists, it adds it to the `$and` array.
 * If the exact same property-value pair already exists, it does nothing.
 */
export declare function addToQuery<Q extends Query>(targetQuery: Q, query: Q): Q
ArgumentTypeDescription
targetQueryQ
queryQ

Released under the MIT License.