extra-disk-store 0.3.1 → 0.4.0
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/README.md
CHANGED
|
@@ -136,9 +136,9 @@ class LZ4ValueConverter<T> implements IValueConverter<T> {
|
|
|
136
136
|
#### ZstandardValueConverter
|
|
137
137
|
```ts
|
|
138
138
|
class ZstandardValueConverter<T> implements IValueConverter<T> {
|
|
139
|
-
|
|
139
|
+
constructor(
|
|
140
140
|
valueConverter: IValueConverter<T>
|
|
141
141
|
, level: number
|
|
142
|
-
)
|
|
142
|
+
)
|
|
143
143
|
}
|
|
144
144
|
```
|
|
@@ -3,8 +3,7 @@ import { IValueConverter } from "../types";
|
|
|
3
3
|
export declare class ZstandardValueConverter<T> implements IValueConverter<T> {
|
|
4
4
|
private valueConverter;
|
|
5
5
|
private level;
|
|
6
|
-
|
|
7
|
-
static create<T>(valueConverter: IValueConverter<T>, level: number): Promise<ZstandardValueConverter<T>>;
|
|
6
|
+
constructor(valueConverter: IValueConverter<T>, level: number);
|
|
8
7
|
toBuffer(value: T): Promise<Buffer>;
|
|
9
8
|
fromBuffer(value: Buffer): Promise<T>;
|
|
10
9
|
}
|
|
@@ -24,22 +24,18 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.ZstandardValueConverter = void 0;
|
|
27
|
-
const zstd = __importStar(require("@
|
|
27
|
+
const zstd = __importStar(require("@mongodb-js/zstd"));
|
|
28
28
|
class ZstandardValueConverter {
|
|
29
29
|
constructor(valueConverter, level) {
|
|
30
30
|
this.valueConverter = valueConverter;
|
|
31
31
|
this.level = level;
|
|
32
32
|
}
|
|
33
|
-
static async create(valueConverter, level) {
|
|
34
|
-
await zstd.init();
|
|
35
|
-
return new ZstandardValueConverter(valueConverter, level);
|
|
36
|
-
}
|
|
37
33
|
async toBuffer(value) {
|
|
38
34
|
const buffer = await this.valueConverter.toBuffer(value);
|
|
39
|
-
return Buffer.from(zstd.compress(buffer, this.level));
|
|
35
|
+
return Buffer.from(await zstd.compress(buffer, this.level));
|
|
40
36
|
}
|
|
41
37
|
async fromBuffer(value) {
|
|
42
|
-
const buffer = Buffer.from(zstd.decompress(value));
|
|
38
|
+
const buffer = Buffer.from(await zstd.decompress(value));
|
|
43
39
|
return await this.valueConverter.fromBuffer(buffer);
|
|
44
40
|
}
|
|
45
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zstandard-value-converter.js","sourceRoot":"","sources":["../../src/converters/zstandard-value-converter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"zstandard-value-converter.js","sourceRoot":"","sources":["../../src/converters/zstandard-value-converter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAwC;AAGxC,MAAa,uBAAuB;IAClC,YACU,cAAkC,EAClC,KAAa;QADb,mBAAc,GAAd,cAAc,CAAoB;QAClC,UAAK,GAAL,KAAK,CAAQ;IACpB,CAAC;IAEJ,KAAK,CAAC,QAAQ,CAAC,KAAQ;QACrB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QACxD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAC7D,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,KAAa;QAC5B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAA;QACxD,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;IACrD,CAAC;CACF;AAfD,0DAeC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "extra-disk-store",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"files": [
|
|
7
|
-
"lib"
|
|
8
|
-
"migrations"
|
|
7
|
+
"lib"
|
|
9
8
|
],
|
|
10
9
|
"main": "lib/index.js",
|
|
11
10
|
"types": "lib/index.d.ts",
|
|
@@ -14,7 +13,7 @@
|
|
|
14
13
|
"license": "MIT",
|
|
15
14
|
"sideEffects": false,
|
|
16
15
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
16
|
+
"node": ">=16"
|
|
18
17
|
},
|
|
19
18
|
"scripts": {
|
|
20
19
|
"prepare": "ts-patch install -s",
|
|
@@ -36,15 +35,14 @@
|
|
|
36
35
|
}
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
|
-
"@blackglory/
|
|
40
|
-
"@blackglory/structures": "^0.11.5",
|
|
38
|
+
"@blackglory/structures": "^0.11.6",
|
|
41
39
|
"@commitlint/cli": "^17.3.0",
|
|
42
40
|
"@commitlint/config-conventional": "^17.3.0",
|
|
43
41
|
"@types/jest": "^29.2.4",
|
|
44
42
|
"@types/node": "14",
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
46
|
-
"@typescript-eslint/parser": "^5.
|
|
47
|
-
"eslint": "^8.
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
|
44
|
+
"@typescript-eslint/parser": "^5.47.0",
|
|
45
|
+
"eslint": "^8.30.0",
|
|
48
46
|
"husky": "^4.3.0",
|
|
49
47
|
"jest": "^29.3.1",
|
|
50
48
|
"npm-run-all": "^4.1.5",
|
|
@@ -53,19 +51,19 @@
|
|
|
53
51
|
"standard-version": "^9.5.0",
|
|
54
52
|
"ts-jest": "^29.0.3",
|
|
55
53
|
"ts-node": "^10.9.1",
|
|
56
|
-
"ts-patch": "^2.0
|
|
54
|
+
"ts-patch": "^2.1.0",
|
|
57
55
|
"tsconfig-paths": "^4.1.1",
|
|
58
56
|
"typescript": "4.8",
|
|
59
57
|
"typescript-transform-paths": "^3.4.4"
|
|
60
58
|
},
|
|
61
59
|
"dependencies": {
|
|
62
|
-
"@blackglory/prelude": "^0.
|
|
63
|
-
"@
|
|
60
|
+
"@blackglory/prelude": "^0.2.0",
|
|
61
|
+
"@mongodb-js/zstd": "^1.0.0",
|
|
64
62
|
"extra-benchmark": "^0.2.2",
|
|
65
63
|
"extra-filesystem": "^0.4.8",
|
|
66
64
|
"extra-promise": "^4.4.0",
|
|
67
|
-
"extra-utils": "^
|
|
68
|
-
"iterable-operator": "^
|
|
65
|
+
"extra-utils": "^4.0.0",
|
|
66
|
+
"iterable-operator": "^3.0.0",
|
|
69
67
|
"lmdb": "^2.7.3",
|
|
70
68
|
"lz4-wasm-nodejs": "^0.9.2"
|
|
71
69
|
}
|