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.0
Release Notes
planttheidea/fast-equals (fast-equals)
v5.0.1
Compare Source
Bugfixes
metaOverride
in typings and documentation (holdover from temporary API in v5 beta)v5.0.0
Compare Source
Breaking changes
constructor
equality 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
constructor
s.Map
/Set
comparisons no longer support IE11In previous verisons,
.forEach()
was used to ensure that support forSymbol
was not required, as IE11 did not haveSymbol
and therefore bothMap
andSet
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 changedTo better facilitate strict comparisons, but also to allow for
meta
use separate from caching, the contract forcreateCustomEqual
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 generalstate
object which containsmeta
cache
now also lives on thestate
object, which allows for use of themeta
property separate from but in parallel with the circular cacheequals
is now onstate
, which prevents the need to pass through the separateisEqual
method for the equality comparatorcreateCustomCircularEqual
has been removedYou can create a custom circular equality comparator through
createCustomEqual
now by providingcircular: true
to the options.Custom
meta
values are no longer passed at callsiteTo use
meta
properties for comparisons, they must be returned in acreateState
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
supportSupport for comparing all typed array values is now supported, and you can provide a custom comparator via the new
areTypedArraysEqual
option in thecreateCustomEqual
configuration.Better build system resolution
The library now leverages the
exports
property in thepackage.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 tocreateCustomEqual
configurationIf you want a custom comparator for primitive wrappers (
new Boolean()
/new Number()
/new String()
) it is now available.v4.0.3
Compare Source
v4.0.2
Compare Source
createCustomCircularEqual
typing is incorrectv4.0.1
Compare Source
index.d.ts
filev4.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:
RegExp.prototype.flags
WeakMap
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
andcreateCustomCircularEqual
for more details.createCustomEqual
contract has changedTo 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
addedLike
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
v3.0.2
Compare Source
RegExp
comparison in modern environmentsv3.0.1
Compare Source
v3.0.0
Compare 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
undefined
parameters, or you can use the parameters to further improve / clarify the logic.v2.0.4
Compare Source
Map
/Set
can create false equality successMap
being a part ofdeepEqual
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.
This PR has been generated by Mend Renovate. View repository job log here.