flightcontrolhq / superjson

Safely serialize JavaScript expressions to a superset of JSON, which includes Dates, BigInts, and more.
https://www.flightcontrol.dev?ref=superjson
MIT License
4.01k stars 87 forks source link

referential equalities are unnecessarily noisy #245

Closed KATT closed 1 year ago

KATT commented 1 year ago

given object

const obj = {
  children: [],
}
const input = {
  a: obj,
  b: obj,
};

It's key to say that path b === a, but it's redundant to say that a.children === b.children. This is currently the case

The above currently gives refentialEqualities of:

{
  "a": [
    "b"
  ],
  "a.children": [
    "b.children"
  ]
}

Causes big complex payloads to be reallllyyyy noisy.