Skip to content

Commit

Permalink
fix(includes): remove object check
Browse files Browse the repository at this point in the history
Remove the object check in the each callback
because each doesn't return objects when follow
is true
  • Loading branch information
Sean Hamilton committed Dec 5, 2018
1 parent 271eebc commit 8c7ff94
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/includes.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,12 @@ function includes(object, value, follow = false) {
each(object, (key, objValue) => {
// if the result isn't already true
if (!result) {
// follow is false or follow is true but the
// object value isn't an object
if (!follow || (follow && !is(value))) {
// check if the object value is equal to
// the specified value
if (objValue === value) {
// if they are the same set the result
// to true
result = true;
}
// check if the object value is equal to
// the specified value
if (objValue === value) {
// if they are the same set the result
// to true
result = true;
}
}
}, follow);
Expand Down

0 comments on commit 8c7ff94

Please # to comment.