Replacing compact with simple undefined check instead, fixes #603

This commit is contained in:
James Barnsley
2020-09-27 20:44:14 +13:00
parent 6e4baf74b3
commit 9b7f86b5e8
5 changed files with 11 additions and 7 deletions

View File

@ -25,7 +25,9 @@ const indexToArray = (index, keys) => {
* @return Array
* */
const arrayOf = (property, items = []) => {
return compact(items.map((item) => item[property]));
const array = [];
items.forEach((item) => (item[property] !== undefined ? array.push(item[property]) : null));
return array;
};