ember-cli/ember-try

View on GitHub
lib/utils/find-by-name.js

Summary

Maintainability
A
0 mins
Test Coverage
'use strict';

module.exports = function findByName(arr, name) {
  let matches = (arr || []).filter((item) => {
    if (item.name === name) {
      return item;
    }
  });
  return matches[0];
};