Skip to content
This repository has been archived by the owner on Jul 9, 2018. It is now read-only.

is-shallow-equal: Fall back to strict equality for non-object-like #116

Merged
merged 3 commits into from
May 1, 2018

Conversation

aduth
Copy link
Member

@aduth aduth commented Apr 25, 2018

This pull request seeks to resolve an issue / enhance behavior of isShallowEqual to account for cases where the arguments passed are not strictly object-like (arrays or objects). In particular, this is useful in cases where one of the two arguments may be undefined.

Implementation notes:

Included are some assorted general refactorings. After poring endlessly over benchmark results on trivial details, I've deemphasized "winning". The latest benchmarks still have the included implementation as the most performant option, though I have found these results to vary unexpectedly.

Testing instructions:

Ensure unit tests pass:

npm test

@codecov
Copy link

codecov bot commented Apr 25, 2018

Codecov Report

Merging #116 into master will decrease coverage by 0.04%.
The diff coverage is 96.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #116      +/-   ##
==========================================
- Coverage   67.39%   67.34%   -0.05%     
==========================================
  Files          56       56              
  Lines         690      689       -1     
  Branches      142      143       +1     
==========================================
- Hits          465      464       -1     
  Misses        183      183              
  Partials       42       42
Impacted Files Coverage Δ
packages/is-shallow-equal/index.js 100% <100%> (+3.03%) ⬆️
packages/is-shallow-equal/objects.js 100% <100%> (ø) ⬆️
packages/is-shallow-equal/arrays.js 88.88% <88.88%> (-11.12%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fdc7f0b...34fbb9d. Read the comment docs.

@aduth aduth merged commit e83cca2 into master May 1, 2018
@aduth aduth deleted the update/is-shallow-equal-undef branch May 1, 2018 17:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant