Skip to content

Commit

Permalink
0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
JasperAtD2L committed Apr 13, 2021
1 parent 6a71d93 commit 2a7690e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const Compression = require('simple-object-compressor');
const compression = new Compression({
testAttribute: 'ta',
testValue: 'tv',
}, {
maxDepth: -1,
});

compression.compact({ testAttribute: ['testValue'] });
Expand All @@ -18,3 +20,14 @@ compression.expand({ ta: ['tv'] });
// { testAttribute: ['testValue'] }

```

## Options

- maxDepth {number} Default -1: Max depth to compress. Root of the object is 0. -1 is no limit. Arrays contents do not count as a depth increase.
```javascript
{
depth0: {
depth1: ['depth1', { depth2: {} }],
}
}
```
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-object-compressor",
"version": "0.0.3",
"version": "0.0.4",
"description": "Compresses/Expands an object's keys by an abbreviation map.",
"main": "Compression.js",
"scripts": {
Expand Down

0 comments on commit 2a7690e

Please sign in to comment.