UNPKG

197 BJavaScriptView Raw
1'use strict';
2
3module.exports = function findByName(arr, name) {
4 let matches = (arr || []).filter((item) => {
5 if (item.name === name) {
6 return item;
7 }
8 });
9 return matches[0];
10};