UNPKG

smart-json-diff

Version:

A modern, compact JSON comparison library with path-aware output and multiple output modes

17 lines (16 loc) 481 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.diffSummary = diffSummary; exports.hasChanges = hasChanges; const diff_1 = require("./diff"); function diffSummary(a, b) { const diff = (0, diff_1.smartJsonDiff)(a, b); return { totalChanges: diff.length, paths: diff.map((d) => d.path), }; } function hasChanges(a, b, options) { const diff = (0, diff_1.smartJsonDiff)(a, b, options); return diff.length > 0; }