aclaración: este es un tipo de identificación de software (y no sé si está permitido aquí)
Hace un tiempo vi una aplicación que utilizaba una biblioteca de JavaScript para transformar objetos anidados en uno plano como este
var a = { attr1: "some value", attr2: new Date(), b: { attr1: "some other value", } } aba = a transform(a) /* [{ ref: 0, attr1: { type: "string", value: "some value" }, attr2: { type: "Date", value: "2022-03-09T16:17:03.216Z" }, b: { type: "ref", value: "1" } },{ ref: 1, attr1: { type: "string", value: "some other value" }, b: { type: "ref", value: "0" } }] */¿Alguien sabe de una biblioteca o estándar para hacer eso?