Skip to main content
This release was yanked — the latest version of @coven/compare is 0.3.3. Jump to latest

Built and signed on GitHub Actions

⚖️ Minimalist diffing.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
4 months ago (0.0.7)
f
compare

Function to compare a left and a right value, by doing a deep comparison and yielding the differences found with a descriptive object.

f
compareIterables

Function to compare a left and a right which are both iterables.

f
compareObjects

Function to compare a left and a right which are both objects.

f
compareProperties

Function to compare a left and a right properties which are both objects.

v
CREATE

Create Difference kind.

T
CreateDifference

Object that represents a creation difference (a new value or property).

v
DELETE

Delete Difference kind.

T
DeleteDifference

Object that represents a deletion difference (a value or property was removed).

T
Difference

Union of all types of differences (CreateDifference, DeleteDifference and UpdateDifference).

T
DifferencePath

Type to be extended by other differences (all differences should have a path to the property).

v
DONE

IteratorResult.done property.

f
getKeys

Recursively get all object keys going up the prototype chain.

f
isObject

Validate given value is an object skipping null.

v
KIND

Name of kind in result.

v
LEFT

Name of left value.

v
MISSING

Symbol used to represent a missing value (because undefined is valid).

v
NEXT

Iterator.next method.

v
PATH

Name of path in result.

f
pathPrepend

Prepends the given property to the given Difference's path.

v
RIGHT

Name of right value.

v
UPDATE

Update Difference kind.

T
UpdateDifference

Object that represents an update difference (a value or property changed).

v
VALUE

IteratorResult.value property.

f
valueToDifference

Turns the given left and right values into one of the following: