Fix some linter errors and warnings
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
// Code from https://github.com/HeroicEric/ember-group-by (MIT licensed)
|
||||
//
|
||||
import { A } from '@ember/array';
|
||||
import { get } from '@ember/object';
|
||||
import { isPresent } from '@ember/utils';
|
||||
|
||||
export default function groupBy (collection, property) {
|
||||
@@ -11,11 +10,11 @@ export default function groupBy (collection, property) {
|
||||
|
||||
if (items) {
|
||||
items.forEach(function(item) {
|
||||
let value = get(item, property);
|
||||
let value = item[property];
|
||||
let group = groups.findBy('value', value);
|
||||
|
||||
if (isPresent(group)) {
|
||||
get(group, 'items').push(item);
|
||||
group.items.push(item);
|
||||
} else {
|
||||
group = { property: property, value: value, items: [item] };
|
||||
groups.push(group);
|
||||
|
||||
Reference in New Issue
Block a user