@ecomplus/utils
Version:
JS utility functions to E-Com Plus (not only) related apps
19 lines • 706 B
TypeScript
export default findByName;
/**
* @method
* @memberof ecomUtils
* @name findByName
* @description Find object from list by name or title value.
* @param {Array} list - List of nested objects
* @param {string} title - Object (category, brand, product...) name or title value
* @returns {Object.<string, *>|undefined}
*
* @example
* const listOfNested = [{"name": "Ultimate Blaster", "sku": "MHP4824"}, {"name": "Xiaomi","sku": "smtp-xomi-9746"}]
* ecomUtils.findByName(listOfNested, 'Ultimate Blaster')
* // => {name: "Ultimate Blaster", sku: "MHP4824"}
*/
declare function findByName(list: any[], title: string): {
[x: string]: any;
} | undefined;
//# sourceMappingURL=find-by-name.d.ts.map