1.0.2 • Published 8 months ago

@tomsd/coflater v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

coflater

It flattens a deep object and restores a flattened object.

npm.io

Installation

npm install @tomsd/coflater

Usage

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
1.0.2

8 months ago

1.0.1

2 years ago

1.0.0

2 years ago