SkillAgentSearch skills...

ObjectDiff.js

Compares JavaScript objects

Install / Use

/learn @NV/ObjectDiff.js
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

objectDiff

objectdiff on npm

objectDiff.diff(objectA, objectB)

<pre> objectDiff.diff({x: 1}, {x: 2}) -> { changed: "object change", value: { x: { changed: "primitive change", removed: 1, added: 2 } } } objectDiff.diff({z: {x: 1}}, {z: {y: 2}}) -> { changed: "object change", value: { z: { changed: "object change", value: { x: { changed: "removed", value: 1 }, y: { changed: "added", value: 2 } } } } } </pre>

objectDiff.diffOwnProperties(objectA, objectB)

Same as objectDiff.diff, but compares only objects' own properties

<pre> function A(){} A.prototype.x = 1 objectDiff.diff({x: 1}, new A) -> {changed: "equal", value: {x: 1}} objectDiff.diffOwnProperties({x: 1}, new A) -> {changed: "object change", value: {x: {changed: "removed", value: 1}}} </pre>

objectDiff.convertToXMLString(diffObject)

Used on the demo page.

Jasmine integration

objectDiff provides toEqualProperties and toEqualOwnProperties matchers for Jasmine. See example spec.

View on GitHub
GitHub Stars260
CategoryDevelopment
Updated12d ago
Forks37

Languages

JavaScript

Security Score

100/100

Audited on Mar 16, 2026

No findings