diffPayloads static method

List<PayloadDiff> diffPayloads(
  1. Object? raw,
  2. Object? normalized, {
  3. int maxInlineLength = 56,
})

Return changed JSON paths between raw and normalized.

This is useful for developer tooling and previews that need to explain what normalizePayload changed before rendering.

Implementation

static List<PayloadDiff> diffPayloads(
  Object? raw,
  Object? normalized, {
  int maxInlineLength = 56,
}) {
  final out = <PayloadDiff>[];
  _collectPayloadDiffsRecursive(raw, normalized, r'$', out, maxInlineLength);
  return out;
}