npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@2utils/is-equal

v0.0.10

Published

An ordinary isEqual func

Downloads

36

Readme

@2utils/is-equal

An ordinary isEqual function.

npm i @2utils/is-equal

Tests

Tests were brazenly stolen from lodash

Passed

  • [x] should compare primitives
  • [x] should compare arrays
  • [x] should treat arrays with identical values but different non-index properties as equal
  • [x] should compare sparse arrays
  • [x] should compare plain objects
  • [x] should compare objects regardless of key order
  • [x] should compare nested objects
  • [x] should compare object instances
  • [x] should compare functions
  • [x] should compare objects with constructor properties
  • [x] should compare objects with shared property values
  • [x] should avoid common type coercions
  • [x] should compare arguments objects
  • [x] should compare date objects
  • [x] should compare functions
  • [x] should return an unwrapped value when implicitly chaining
  • [x] should compare maps
  • [x] should compare regexes
  • [x] should compare sets
  • [x] should compare buffers
  • [x] should compare array buffers
  • [x] should treat objects created by Object.create(null) like plain objects

Not passed

Circular

  • [ ] should compare arrays with circular references
  • [ ] should have transitive equivalence for circular references of arrays
  • [ ] should compare objects with circular references
  • [ ] should have transitive equivalence for circular references of objects
  • [ ] should compare objects with multiple circular references
  • [ ] should compare objects with complex circular references
  • [ ] should compare maps with circular references
  • [ ] should compare sets with circular references

  • [ ] should compare array views
  • [ ] should compare error objects
  • [ ] should compare promises by reference
  • [ ] should compare symbol properties
  • [ ] should compare wrapped values
  • [ ] should compare wrapped and non-wrapped values
  • [ ] should work as an iteratee for _.every
  • [ ] should not error on DOM elements
  • [ ] should return true for like-objects from different documents
  • [ ] should return false for objects with custom toString methods
  • [ ] should return a wrapped value when explicitly chaining

Benchmark

Tests were run from the fast-deep-equal package. They don 't show the real picture because I don 't cover all test cases. Just for fun.

| pos. | package | results | | :----- | :---------------------- | :------------------------------------------ | | 1. | fast-deep-equal | 218,604 ops/sec ±2.32% (80 runs sampled) | | 2. | 🐢 @2utils/is-equal | 201,469 ops/sec ±2.59% (83 runs sampled) | | 3. | fast-equals | 195,025 ops/sec ±3.06% (79 runs sampled) | | 4. | fast-deep-equal/es6 | 192,544 ops/sec ±2.60% (82 runs sampled) | | 5. | nano-equal | 126,143 ops/sec ±2.68% (79 runs sampled) | | 6. | shallow-equal-fuzzy | 112,192 ops/sec ±1.96% (83 runs sampled) | | 7. | underscore.isEqual | 62,441 ops/sec ±1.78% (86 runs sampled) | | 8. | util.isDeepStrictEqual | 45,652 ops/sec ±1.69% (85 runs sampled) | | 9. | lodash.isEqual | 34,102 ops/sec ±1.55% (87 runs sampled) | | 10. | deep-eql | 28,662 ops/sec ±5.36% (78 runs sampled) | | 11. | ramda.equals | 10,623 ops/sec ±1.84% (86 runs sampled) | | 12. | assert.deepStrictEqual | 271 ops/sec ±1.22% (82 runs sampled) | | 13. | deep-equal | 61.11 ops/sec ±4.58% (40 runs sampled) |