fix(deps): update dependency fast-equals to v5 #144
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^2.0.3->^5.0.0Release Notes
planttheidea/fast-equals (fast-equals)
v5.0.1Compare Source
Bugfixes
metaOverridein typings and documentation (holdover from temporary API in v5 beta)v5.0.0Compare Source
Breaking changes
constructorequality now requiredTo 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/Setcomparisons no longer support IE11In previous verisons,
.forEach()was used to ensure that support forSymbolwas not required, as IE11 did not haveSymboland therefore bothMapandSetdid 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.createCustomEqualcontract has changedTo better facilitate strict comparisons, but also to allow for
metause separate from caching, the contract forcreateCustomEqualhas changed. See the README documentation for more details, but froma high-level:metais no longer passed through to equality comparators, but rather a generalstateobject which containsmetacachenow also lives on thestateobject, which allows for use of themetaproperty separate from but in parallel with the circular cacheequalsis now onstate, which prevents the need to pass through the separateisEqualmethod for the equality comparatorcreateCustomCircularEqualhas been removedYou can create a custom circular equality comparator through
createCustomEqualnow by providingcircular: trueto the options.Custom
metavalues are no longer passed at callsiteTo use
metaproperties for comparisons, they must be returned in acreateStatemethod.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:
strictDeepEqualstrictShallowEqualstrictCircularDeepEqualstrictCircularShallowEqualThis 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.TypedArraysupportSupport for comparing all typed array values is now supported, and you can provide a custom comparator via the new
areTypedArraysEqualoption in thecreateCustomEqualconfiguration.Better build system resolution
The library now leverages the
exportsproperty in thepackage.jsonto 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.arePrimitiveWrappersEqualoption added tocreateCustomEqualconfigurationIf you want a custom comparator for primitive wrappers (
new Boolean()/new Number()/new String()) it is now available.v4.0.3Compare Source
v4.0.2Compare Source
createCustomCircularEqualtyping is incorrectv4.0.1Compare Source
index.d.tsfilev4.0.0Compare 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:
RegExp.prototype.flagsWeakMapDue 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
createCustomEqualandcreateCustomCircularEqualfor more details.createCustomEqualcontract has changedTo allow more flexibility and customizability for a variety of edge cases,
createCustomEqualnow allows override of specific type value comparisons in addition to the general comparator it did prior. See the documentation for more details.Enhancements
createCustomCircularEqualaddedLike
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.,instanceofwas 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
metavalues, typings have been refactored for accuracy and better narrow flow-through.v3.0.3Compare Source
v3.0.2Compare Source
RegExpcomparison in modern environmentsv3.0.1Compare Source
v3.0.0Compare Source
Breaking changes
When creating a custom equality comparator via
createCustomEqual, the equality method has an expanded contract:If you have a custom equality comparator, you can ignore the differences by just passing additional
undefinedparameters, or you can use the parameters to further improve / clarify the logic.v2.0.4Compare Source
Map/Setcan create false equality successMapbeing a part ofdeepEqualConfiguration
📅 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.
This PR has been generated by Mend Renovate. View repository job log here.