Skip to content

Commit

Permalink
Support ObjectId matches using lodash.isEqual
Browse files Browse the repository at this point in the history
This time in arrays.
  • Loading branch information
marshallswain committed Jul 22, 2020
1 parent 4e3e27d commit e38f8d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/shallow-populate.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function getRelatedItems (ids, relatedItems, include) {
currentId = keyThereVal
}
if (asArray) {
if ((Array.isArray(currentId) && currentId.includes(id)) || currentId === id) {
if ((Array.isArray(currentId) && currentId.includes(id)) || isEqual(currentId, id)) {
items.push(currentItem)
}
} else {
Expand Down

0 comments on commit e38f8d4

Please sign in to comment.