Skip to content
This repository was archived by the owner on Sep 3, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: multiformats/js-cid
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1.0
Choose a base ref
...
head repository: multiformats/js-cid
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.1.1
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Dec 11, 2020

  1. fix: allow CIDs to be compared through deep equality

    The changes in #131 broke the tests of IPFS and probably quite a few
    other modules.
    
    This sort of thing used to work, now does not:
    
    ```js
    expect(ipfs.bitswap.unwant.calledWith(new CID(cidStr), defaultOptions)).to.be.true()
    ```
    
    The reason it breaks is because internally `calledWith` does a `deepEqual`
    on the args which compares (among other things) the properties of the passed
    objects.
    
    We used to use `Object.defineProperty` to create cached versions of
    expensive to calculate fields which makes fields non-enumerable by
    default so they are skipped during the `deepEqual` check.
    
    Now we just set the fields on the object which means instances have
    different fields depending on which constructor branch was hit or worse,
    if the instances properties have been accessed.
    achingbrain authored and vmx committed Dec 11, 2020
    Configuration menu
    Copy the full SHA
    127745e View commit details
    Browse the repository at this point in the history
  2. chore: update contributors

    vmx committed Dec 11, 2020
    Configuration menu
    Copy the full SHA
    3d638a5 View commit details
    Browse the repository at this point in the history
  3. chore: release version v1.1.1

    vmx committed Dec 11, 2020
    Configuration menu
    Copy the full SHA
    765952a View commit details
    Browse the repository at this point in the history
Loading