compress-json
Advanced tools
Comparing version 3.0.6 to 3.1.0
@@ -204,3 +204,5 @@ "use strict"; | ||
var config = { | ||
// default will not sort the object key | ||
sort_key: false, | ||
// default will convert into null silently like JSON.stringify | ||
error_on_nan: false, | ||
@@ -207,0 +209,0 @@ error_on_infinite: false |
@@ -5,5 +5,7 @@ "use strict"; | ||
exports.config = { | ||
// default will not sort the object key | ||
sort_key: false, | ||
// default will convert into null silently like JSON.stringify | ||
error_on_nan: false, | ||
error_on_infinite: false, | ||
}; |
@@ -5,1 +5,2 @@ export { compress, decompress, Compressed } from './core'; | ||
export { trimUndefined, trimUndefinedRecursively } from './helpers'; | ||
export { config } from './config'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.trimUndefinedRecursively = exports.trimUndefined = exports.addValue = exports.decode = exports.decompress = exports.compress = void 0; | ||
exports.config = exports.trimUndefinedRecursively = exports.trimUndefined = exports.addValue = exports.decode = exports.decompress = exports.compress = void 0; | ||
/* for direct usage */ | ||
@@ -17,1 +17,4 @@ var core_1 = require("./core"); | ||
Object.defineProperty(exports, "trimUndefinedRecursively", { enumerable: true, get: function () { return helpers_1.trimUndefinedRecursively; } }); | ||
/* to config */ | ||
var config_1 = require("./config"); | ||
Object.defineProperty(exports, "config", { enumerable: true, get: function () { return config_1.config; } }); |
{ | ||
"name": "compress-json", | ||
"version": "3.0.6", | ||
"version": "3.1.0", | ||
"description": "convert JSON data to space efficient format", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -207,2 +207,15 @@ # compress-json | ||
## Config | ||
```typescript | ||
import { config } from 'compress-json' | ||
// default will not sort the object key | ||
config.sort_key = true | ||
// default will convert into null silently like JSON.stringify | ||
config.error_on_nan = true | ||
config.error_on_infinite = true | ||
``` | ||
## Benchmark | ||
@@ -209,0 +222,0 @@ |
47263
1142
279