UNPKG

@synotech/utils

Version:

a collection of utilities for internal use

17 lines (16 loc) 544 B
interface AnyObject { [key: string]: any; } /** * This function searches an array of objects for a query string * @module searchObject * @param {string} query - a string to search for * @param {object} objects - an array of objects to search * @return {object} {Array} a well structured json object * @example * * searchObject('John', [{name: 'John Doe'}, {name: 'Jane Doe'}]) // returns [{name: 'John Doe'}] * */ export declare function searchObject(query: string, objects: AnyObject[]): AnyObject[]; export {};