@keyv/compress-lz4 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -3
- package/dist/index.js +1 -0
- package/package.json +11 -9
package/dist/index.cjs
CHANGED
|
@@ -24,6 +24,7 @@ __export(index_exports, {
|
|
|
24
24
|
default: () => index_default
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(index_exports);
|
|
27
|
+
var import_node_buffer = require("buffer");
|
|
27
28
|
var import_lz4_napi = require("lz4-napi");
|
|
28
29
|
var import_serialize = require("@keyv/serialize");
|
|
29
30
|
var KeyvLz4 = class {
|
|
@@ -31,10 +32,10 @@ var KeyvLz4 = class {
|
|
|
31
32
|
this.dictionary = dictionary;
|
|
32
33
|
}
|
|
33
34
|
async compress(data) {
|
|
34
|
-
return (0, import_lz4_napi.compress)(Buffer.from(data), this.getDictionary());
|
|
35
|
+
return (0, import_lz4_napi.compress)(import_node_buffer.Buffer.from(data), this.getDictionary());
|
|
35
36
|
}
|
|
36
37
|
async decompress(data) {
|
|
37
|
-
const value = await (0, import_lz4_napi.uncompress)(Buffer.from(data), this.getDictionary());
|
|
38
|
+
const value = await (0, import_lz4_napi.uncompress)(import_node_buffer.Buffer.from(data), this.getDictionary());
|
|
38
39
|
return value.toString("utf8");
|
|
39
40
|
}
|
|
40
41
|
async serialize({ value, expires }) {
|
|
@@ -48,7 +49,7 @@ var KeyvLz4 = class {
|
|
|
48
49
|
}
|
|
49
50
|
getDictionary() {
|
|
50
51
|
if (this.dictionary) {
|
|
51
|
-
return Buffer.from(this.dictionary);
|
|
52
|
+
return import_node_buffer.Buffer.from(this.dictionary);
|
|
52
53
|
}
|
|
53
54
|
return void 0;
|
|
54
55
|
}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keyv/compress-lz4",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "lz4 compression for Keyv",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -37,17 +37,19 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://github.com/jaredwray/keyv",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"lz4-napi": "^2.
|
|
41
|
-
"@keyv/serialize": "^1.0.
|
|
42
|
-
|
|
40
|
+
"lz4-napi": "^2.9.0",
|
|
41
|
+
"@keyv/serialize": "^1.0.3"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"keyv": "^5.3.4"
|
|
43
45
|
},
|
|
44
46
|
"devDependencies": {
|
|
45
|
-
"@vitest/coverage-v8": "^2.
|
|
47
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
46
48
|
"c8": "^10.1.3",
|
|
47
49
|
"rimraf": "^6.0.1",
|
|
48
|
-
"vitest": "^2.
|
|
49
|
-
"xo": "^
|
|
50
|
-
"@keyv/test-suite": "^2.0.
|
|
50
|
+
"vitest": "^3.2.4",
|
|
51
|
+
"xo": "^1.1.1",
|
|
52
|
+
"@keyv/test-suite": "^2.0.9"
|
|
51
53
|
},
|
|
52
54
|
"tsd": {
|
|
53
55
|
"directory": "test"
|
|
@@ -62,7 +64,7 @@
|
|
|
62
64
|
"scripts": {
|
|
63
65
|
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
|
|
64
66
|
"test": "xo --fix && vitest run --coverage",
|
|
65
|
-
"test:ci": "xo && vitest --run --sequence.setupFiles=list",
|
|
67
|
+
"test:ci": "xo && vitest --run --sequence.setupFiles=list --coverage",
|
|
66
68
|
"clean": "rimraf ./node_modules ./coverage ./test/testdb.sqlite ./dist"
|
|
67
69
|
}
|
|
68
70
|
}
|