It flattens a deep object and restores a flattened object.
npm install @tomsd/coflater
import { Coflater } from "@tomsd/coflater";
const coflater = new Coflater();
const original = {
a: {
b: {
c: 1,
d: false,
}
},
z: "s",
};
const deflated = coflater.deflate(original);
console.log(deflated); // {"a.b.c": 1, "a.b.d": false, z: "s" }
const inflated = coflater.inflate(deflated);
console.log(inflated); // equals to original