Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency fast-equals to v5 #144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Mar 26, 2022

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
fast-equals ^2.0.3 -> ^5.0.0 age adoption passing confidence

Release Notes

planttheidea/fast-equals (fast-equals)

v5.0.1

Compare Source

Bugfixes
  • Fix reference to metaOverride in typings and documentation (holdover from temporary API in v5 beta)

v5.0.0

Compare Source

Breaking changes
constructor equality now required

To align with other implementations common in the community, but also to be more functionally correct, the two objects being compared now must have equal constructors.

Map / Set comparisons no longer support IE11

In previous verisons, .forEach() was used to ensure that support for Symbol was not required, as IE11 did not have Symbol and therefore both Map and Set did not have iterator-based methods such as .values() or .entries(). Since IE11 is no longer a supported browser, and support for those methods is present in all browsers and Node for quite a while, the comparison has moved to use these methods. This results in a ~20% performance increase.

createCustomEqual contract has changed

To better facilitate strict comparisons, but also to allow for meta use separate from caching, the contract for createCustomEqual has changed. See the README documentation for more details, but froma high-level:

  • meta is no longer passed through to equality comparators, but rather a general state object which contains meta
  • cache now also lives on the state object, which allows for use of the meta property separate from but in parallel with the circular cache
  • equals is now on state, which prevents the need to pass through the separate isEqual method for the equality comparator
createCustomCircularEqual has been removed

You can create a custom circular equality comparator through createCustomEqual now by providing circular: true to the options.

Custom meta values are no longer passed at callsite

To use meta properties for comparisons, they must be returned in a createState method.

Deep links have changed

If you were deep-linking into a specific asset type (ESM / CJS / UMD), they have changed location.

NOTE: You may no longer need to deep-link, as the build resolution has improved.

Enhancements
New "strict" comparators available

The following new comparators are available:

  • strictDeepEqual
  • strictShallowEqual
  • strictCircularDeepEqual
  • strictCircularShallowEqual

This will perform the same comparisons as their non-strict counterparts, but will verify additional properties (non-enumerable properties on objects, keyed objects on Array / Map / Set) and that the descriptors for the properties align.

TypedArray support

Support for comparing all typed array values is now supported, and you can provide a custom comparator via the new areTypedArraysEqual option in the createCustomEqual configuration.

Better build system resolution

The library now leverages the exports property in the package.json to provide builds specific to your method of consumption (ESM / CommonJS / UMD). There is still a minified UMD version available if you want to use it instead.

arePrimitiveWrappersEqual option added to createCustomEqual configuration

If you want a custom comparator for primitive wrappers (new Boolean() / new Number() / new String()) it is now available.

v4.0.3

Compare Source

  • Remove unnecessary second strict equality check for objects in edge-case scenarios

v4.0.2

Compare Source

  • #​85 - createCustomCircularEqual typing is incorrect

v4.0.1

Compare Source

  • #​81 - Fix typing issues related to importing in index.d.ts file

v4.0.0

Compare Source

Breaking Changes
Certain ES2015 features are now required

In previous versions, there were automatic fallbacks for certain ES2015 features if they did not exist:

Due to the omnipresence of support in both browser and NodeJS, these have been deprecated. There is still an option if you require support for these legacy environments, however; see createCustomEqual and createCustomCircularEqual for more details.

createCustomEqual contract has changed

To allow more flexibility and customizability for a variety of edge cases, createCustomEqual now allows override of specific type value comparisons in addition to the general comparator it did prior. See the documentation for more details.

Enhancements
createCustomCircularEqual added

Like createCustomEqual, it will create a custom equality comparator, with the exception that it will handle circular references. See the documentation for more details.

Cross-realm comparisons are now supported

Prior to 4.x.x., instanceof was used internally for checking of object classes, which only worked when comparing objects from the same Realm. This has changed to instead use an object's StringTag, which is not realm-specific.

TypeScript typings improved

For better typing in edge-case scenarios like custom comparators with meta values, typings have been refactored for accuracy and better narrow flow-through.

v3.0.3

Compare Source

  • Fix #​77 - better circular object validation

v3.0.2

Compare Source

  • Fix #​73 - support comparison of primitive wrappers
  • #​76 - improve speed and accuracy of RegExp comparison in modern environments

v3.0.1

Compare Source

  • Fix #​71 - use generic types for better type flow-through

v3.0.0

Compare Source

Breaking changes

When creating a custom equality comparator via createCustomEqual, the equality method has an expanded contract:

// Before
type EqualityComparator = (objectA: any, objectB: any, meta: any) => boolean;

// After
type InternalEqualityComparator = (
  objectA: any,
  objectB: any,
  indexOrKeyA: any,
  indexOrKeyB: any,
  parentA: any,
  parentB: any,
  meta: any,
) => boolean;

If you have a custom equality comparator, you can ignore the differences by just passing additional undefined parameters, or you can use the parameters to further improve / clarify the logic.

  • Add #​57 - support additional metadata for custom equality comparators

v2.0.4

Compare Source

  • Fix #​58 - duplicate entries in Map / Set can create false equality success
  • #​60 - Add documentation for key equality of Map being a part of deepEqual

Configuration

📅 Schedule: Branch creation - "every weekend" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Mar 26, 2022
@renovate renovate bot force-pushed the renovate/dependencies branch from b623851 to 1414d1c Compare June 18, 2022 23:44
@renovate renovate bot changed the title fix(deps): update dependency fast-equals to v3 fix(deps): update dependency fast-equals to v4 Jun 18, 2022
@renovate renovate bot changed the title fix(deps): update dependency fast-equals to v4 fix(deps): update dependency fast-equals to v5 Mar 22, 2023
@renovate renovate bot force-pushed the renovate/dependencies branch from 1414d1c to 2ad26cf Compare March 22, 2023 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants