compress-json
Advanced tools
Comparing version 1.0.1 to 1.0.2
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.test = exports.bool_to_s = exports.s_to_bool = void 0; | ||
function s_to_bool(s) { | ||
@@ -4,0 +5,0 @@ switch (s) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.config = void 0; | ||
exports.config = { | ||
sort_key: false, | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.decompress = exports.decode = exports.compress = void 0; | ||
const debug_1 = require("./debug"); | ||
@@ -20,4 +21,8 @@ const encode_1 = require("./encode"); | ||
const key_id = vs[1]; | ||
const keys = decode(values, key_id); | ||
let keys = decode(values, key_id); | ||
const n = vs.length; | ||
if (n - 2 === 1 && !Array.isArray(keys)) { | ||
// single-key object using existing value as key | ||
keys = [keys]; | ||
} | ||
for (let i = 2; i < n; i++) { | ||
@@ -24,0 +29,0 @@ const k = keys[i - 2]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.throwUnknownDataType = exports.getType = void 0; | ||
function getType(o) { | ||
@@ -4,0 +5,0 @@ return Object.prototype.toString.call(o); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.decodeStr = exports.encodeStr = exports.decodeBool = exports.encodeBool = exports.decodeKey = exports.decodeNum = exports.encodeNum = void 0; | ||
const number_1 = require("./number"); | ||
@@ -49,4 +50,5 @@ function encodeNum(num) { | ||
function decodeStr(s) { | ||
return s.replace('s|', ''); | ||
const prefix = s[0] + s[1]; | ||
return prefix === 's|' ? s.substr(2) : s; | ||
} | ||
exports.decodeStr = decodeStr; |
@@ -5,8 +5,8 @@ "use strict"; | ||
var core_1 = require("./core"); | ||
exports.compress = core_1.compress; | ||
exports.decompress = core_1.decompress; | ||
Object.defineProperty(exports, "compress", { enumerable: true, get: function () { return core_1.compress; } }); | ||
Object.defineProperty(exports, "decompress", { enumerable: true, get: function () { return core_1.decompress; } }); | ||
/* for custom wrapper */ | ||
var core_2 = require("./core"); | ||
exports.decode = core_2.decode; | ||
Object.defineProperty(exports, "decode", { enumerable: true, get: function () { return core_2.decode; } }); | ||
var memory_1 = require("./memory"); | ||
exports.addValue = memory_1.addValue; | ||
Object.defineProperty(exports, "addValue", { enumerable: true, get: function () { return memory_1.addValue; } }); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.addValue = exports.makeInMemoryMemory = exports.makeInMemoryCache = exports.makeInMemoryStore = exports.memToValues = void 0; | ||
const config_1 = require("./config"); | ||
@@ -4,0 +5,0 @@ const debug_1 = require("./debug"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.s_to_num = exports.num_to_s = exports.int_to_s = exports.s_to_int = void 0; | ||
let i_to_s = ''; | ||
@@ -4,0 +5,0 @@ for (let i = 0; i < 10; i++) { |
{ | ||
"name": "compress-json", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "convert JSON data to space efficient format", | ||
"keywords": [], | ||
"author": "Beeno Tung <aabbcc1241@yahoo.com.hk> (https://beeno-tung.surge.sh)", | ||
"keywords": [ | ||
"json", | ||
"compress" | ||
], | ||
"author": { | ||
"name": "Beeno Tung", | ||
"email": "aabbcc1241@yahoo.com.hk", | ||
"url": "https://beeno-tung.surge.sh" | ||
}, | ||
"license": "BSD-2-Clause", | ||
@@ -8,0 +15,0 @@ "main": "dist/index.js", |
@@ -174,1 +174,3 @@ # compress-json | ||
## License | ||
[BSD 2-Clause License](./LICENSE) (Free Open Sourced Software) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21722
19
479
176