@quereus/plugin-leveldb 3.3.0 → 4.1.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 +197 -166
- package/dist/src/plugin.d.ts +10 -3
- package/dist/src/plugin.d.ts.map +1 -1
- package/dist/src/plugin.js +2 -0
- package/dist/src/plugin.js.map +1 -1
- package/dist/src/provider.d.ts +77 -21
- package/dist/src/provider.d.ts.map +1 -1
- package/dist/src/provider.js +297 -147
- package/dist/src/provider.js.map +1 -1
- package/dist/src/store.d.ts +47 -7
- package/dist/src/store.d.ts.map +1 -1
- package/dist/src/store.js +70 -25
- package/dist/src/store.js.map +1 -1
- package/package.json +19 -11
package/dist/src/store.d.ts
CHANGED
|
@@ -1,27 +1,67 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* LevelDB-based KVStore implementation for Node.js.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Backed by classic-level. A store operates over an abstract-level handle
|
|
5
|
+
* ({@link ViewLevel}) which is EITHER:
|
|
6
|
+
*
|
|
7
|
+
* - a standalone {@link ClassicLevel} this store owns (via {@link LevelDBStore.open}) —
|
|
8
|
+
* a single physical key-value database used directly (e.g. sync metadata); or
|
|
9
|
+
* - a sublevel of a shared root opened by `LevelDBProvider` (the StoreModule
|
|
10
|
+
* backend), where every table, index, the catalog, and stats share ONE physical
|
|
11
|
+
* LevelDB. See `provider.ts`.
|
|
12
|
+
*
|
|
13
|
+
* `close()` closes the handle. For a standalone store that closes the physical
|
|
14
|
+
* database; for a sublevel it drops the sublevel handle while the shared root
|
|
15
|
+
* stays open (the provider owns the root's lifecycle) — mirroring how
|
|
16
|
+
* `IndexedDBStore.close()` is a per-store handle drop over the shared database.
|
|
5
17
|
*/
|
|
6
|
-
import type {
|
|
18
|
+
import type { AbstractLevel } from 'abstract-level';
|
|
19
|
+
import type { KVStore, KVEntry, WriteBatch, IterateOptions, KVStoreOptions, WriteOptions } from '@quereus/store';
|
|
7
20
|
/**
|
|
8
|
-
*
|
|
21
|
+
* Operational handle: the subset of an abstract-level database this store drives.
|
|
22
|
+
* Both a root {@link ClassicLevel} and one of its sublevels satisfy it — both store
|
|
23
|
+
* raw `Uint8Array` keys/values under the `'view'` encoding.
|
|
24
|
+
*/
|
|
25
|
+
export type ViewLevel = AbstractLevel<string | Buffer | Uint8Array, Uint8Array, Uint8Array>;
|
|
26
|
+
/**
|
|
27
|
+
* LevelDB implementation of KVStore over an abstract-level handle.
|
|
9
28
|
*/
|
|
10
29
|
export declare class LevelDBStore implements KVStore {
|
|
11
|
-
private
|
|
30
|
+
private level;
|
|
12
31
|
private closed;
|
|
13
32
|
private constructor();
|
|
14
33
|
/**
|
|
15
|
-
* Open a LevelDB store.
|
|
34
|
+
* Open a standalone LevelDB store as its own physical database at `options.path`.
|
|
35
|
+
*
|
|
36
|
+
* For single-database key-value use (e.g. sync metadata). The multi-table
|
|
37
|
+
* StoreModule backend does NOT use this — it opens one shared root and hands
|
|
38
|
+
* out sublevel-backed stores via `LevelDBProvider`.
|
|
16
39
|
*/
|
|
17
40
|
static open(options: KVStoreOptions): Promise<LevelDBStore>;
|
|
41
|
+
/**
|
|
42
|
+
* Wrap a sublevel of a shared root as a store. The provider opens the sublevel
|
|
43
|
+
* (off its single root) and owns the root's lifecycle; this store's `close()`
|
|
44
|
+
* only drops the sublevel handle. The sublevel MUST be opened by the caller.
|
|
45
|
+
*/
|
|
46
|
+
static overSublevel(sublevel: ViewLevel): LevelDBStore;
|
|
18
47
|
get(key: Uint8Array): Promise<Uint8Array | undefined>;
|
|
19
|
-
put(key: Uint8Array, value: Uint8Array): Promise<void>;
|
|
20
|
-
delete(key: Uint8Array): Promise<void>;
|
|
48
|
+
put(key: Uint8Array, value: Uint8Array, options?: WriteOptions): Promise<void>;
|
|
49
|
+
delete(key: Uint8Array, options?: WriteOptions): Promise<void>;
|
|
21
50
|
has(key: Uint8Array): Promise<boolean>;
|
|
22
51
|
iterate(options?: IterateOptions): AsyncIterable<KVEntry>;
|
|
23
52
|
batch(): WriteBatch;
|
|
53
|
+
/**
|
|
54
|
+
* Delete every entry in this store's keyspace. For a sublevel this clears only
|
|
55
|
+
* the sublevel's own prefix range — never a sibling sublevel of the shared root.
|
|
56
|
+
*/
|
|
57
|
+
clear(): Promise<void>;
|
|
24
58
|
close(): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Whether this handle has been closed. The provider consults this to evict a
|
|
61
|
+
* cached handle that was closed out-of-band by a consumer (e.g. a StoreTable
|
|
62
|
+
* releasing an index store before a drop) and reopen a fresh one.
|
|
63
|
+
*/
|
|
64
|
+
isClosed(): boolean;
|
|
25
65
|
approximateCount(options?: IterateOptions): Promise<number>;
|
|
26
66
|
private checkOpen;
|
|
27
67
|
}
|
package/dist/src/store.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/store.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EACX,aAAa,EAKb,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEjH;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC,MAAM,GAAG,MAAM,GAAG,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AAa5F;;GAEG;AACH,qBAAa,YAAa,YAAW,OAAO;IAC3C,OAAO,CAAC,KAAK,CAAY;IACzB,OAAO,CAAC,MAAM,CAAS;IAEvB,OAAO;IAIP;;;;;;OAMG;WACU,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAYjE;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,SAAS,GAAG,YAAY;IAIhD,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAMrD,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ9E,MAAM,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAM9D,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAKrC,OAAO,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,aAAa,CAAC,OAAO,CAAC;IA0BhE,KAAK,IAAI,UAAU;IAKnB;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAKtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAS5B;;;;OAIG;IACH,QAAQ,IAAI,OAAO;IAIb,gBAAgB,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAWjE,OAAO,CAAC,SAAS;CAKjB"}
|
package/dist/src/store.js
CHANGED
|
@@ -1,20 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* LevelDB-based KVStore implementation for Node.js.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Backed by classic-level. A store operates over an abstract-level handle
|
|
5
|
+
* ({@link ViewLevel}) which is EITHER:
|
|
6
|
+
*
|
|
7
|
+
* - a standalone {@link ClassicLevel} this store owns (via {@link LevelDBStore.open}) —
|
|
8
|
+
* a single physical key-value database used directly (e.g. sync metadata); or
|
|
9
|
+
* - a sublevel of a shared root opened by `LevelDBProvider` (the StoreModule
|
|
10
|
+
* backend), where every table, index, the catalog, and stats share ONE physical
|
|
11
|
+
* LevelDB. See `provider.ts`.
|
|
12
|
+
*
|
|
13
|
+
* `close()` closes the handle. For a standalone store that closes the physical
|
|
14
|
+
* database; for a sublevel it drops the sublevel handle while the shared root
|
|
15
|
+
* stays open (the provider owns the root's lifecycle) — mirroring how
|
|
16
|
+
* `IndexedDBStore.close()` is a per-store handle drop over the shared database.
|
|
5
17
|
*/
|
|
6
18
|
import { ClassicLevel } from 'classic-level';
|
|
7
19
|
/**
|
|
8
|
-
* LevelDB implementation of KVStore.
|
|
20
|
+
* LevelDB implementation of KVStore over an abstract-level handle.
|
|
9
21
|
*/
|
|
10
22
|
export class LevelDBStore {
|
|
11
|
-
|
|
23
|
+
level;
|
|
12
24
|
closed = false;
|
|
13
|
-
constructor(
|
|
14
|
-
this.
|
|
25
|
+
constructor(level) {
|
|
26
|
+
this.level = level;
|
|
15
27
|
}
|
|
16
28
|
/**
|
|
17
|
-
* Open a LevelDB store.
|
|
29
|
+
* Open a standalone LevelDB store as its own physical database at `options.path`.
|
|
30
|
+
*
|
|
31
|
+
* For single-database key-value use (e.g. sync metadata). The multi-table
|
|
32
|
+
* StoreModule backend does NOT use this — it opens one shared root and hands
|
|
33
|
+
* out sublevel-backed stores via `LevelDBProvider`.
|
|
18
34
|
*/
|
|
19
35
|
static async open(options) {
|
|
20
36
|
const db = new ClassicLevel(options.path, {
|
|
@@ -26,24 +42,34 @@ export class LevelDBStore {
|
|
|
26
42
|
await db.open();
|
|
27
43
|
return new LevelDBStore(db);
|
|
28
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Wrap a sublevel of a shared root as a store. The provider opens the sublevel
|
|
47
|
+
* (off its single root) and owns the root's lifecycle; this store's `close()`
|
|
48
|
+
* only drops the sublevel handle. The sublevel MUST be opened by the caller.
|
|
49
|
+
*/
|
|
50
|
+
static overSublevel(sublevel) {
|
|
51
|
+
return new LevelDBStore(sublevel);
|
|
52
|
+
}
|
|
29
53
|
async get(key) {
|
|
30
54
|
this.checkOpen();
|
|
31
|
-
//
|
|
32
|
-
return await this.
|
|
55
|
+
// abstract-level returns undefined for missing keys (doesn't throw)
|
|
56
|
+
return await this.level.get(key);
|
|
33
57
|
}
|
|
34
|
-
async put(key, value) {
|
|
58
|
+
async put(key, value, options) {
|
|
35
59
|
this.checkOpen();
|
|
36
|
-
|
|
60
|
+
// classic-level forwards `sync` to the underlying LevelDB write, fsync'ing the
|
|
61
|
+
// log before resolving when requested; sublevels forward it to the root.
|
|
62
|
+
const opts = { sync: options?.sync };
|
|
63
|
+
await this.level.put(key, value, opts);
|
|
37
64
|
}
|
|
38
|
-
async delete(key) {
|
|
65
|
+
async delete(key, options) {
|
|
39
66
|
this.checkOpen();
|
|
40
|
-
|
|
67
|
+
const opts = { sync: options?.sync };
|
|
68
|
+
await this.level.del(key, opts);
|
|
41
69
|
}
|
|
42
70
|
async has(key) {
|
|
43
71
|
this.checkOpen();
|
|
44
|
-
|
|
45
|
-
const value = await this.db.get(key);
|
|
46
|
-
return value !== undefined;
|
|
72
|
+
return await this.level.has(key);
|
|
47
73
|
}
|
|
48
74
|
async *iterate(options) {
|
|
49
75
|
this.checkOpen();
|
|
@@ -63,7 +89,7 @@ export class LevelDBStore {
|
|
|
63
89
|
iteratorOptions.reverse = true;
|
|
64
90
|
if (options?.limit !== undefined)
|
|
65
91
|
iteratorOptions.limit = options.limit;
|
|
66
|
-
const iterator = this.
|
|
92
|
+
const iterator = this.level.iterator(iteratorOptions);
|
|
67
93
|
try {
|
|
68
94
|
for await (const [key, value] of iterator) {
|
|
69
95
|
yield { key, value };
|
|
@@ -75,18 +101,36 @@ export class LevelDBStore {
|
|
|
75
101
|
}
|
|
76
102
|
batch() {
|
|
77
103
|
this.checkOpen();
|
|
78
|
-
return new LevelDBWriteBatch(this.
|
|
104
|
+
return new LevelDBWriteBatch(this.level);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Delete every entry in this store's keyspace. For a sublevel this clears only
|
|
108
|
+
* the sublevel's own prefix range — never a sibling sublevel of the shared root.
|
|
109
|
+
*/
|
|
110
|
+
async clear() {
|
|
111
|
+
this.checkOpen();
|
|
112
|
+
await this.level.clear();
|
|
79
113
|
}
|
|
80
114
|
async close() {
|
|
81
115
|
if (!this.closed) {
|
|
82
116
|
this.closed = true;
|
|
83
|
-
|
|
117
|
+
// Standalone: closes the physical database. Sublevel: drops the sublevel
|
|
118
|
+
// handle (detaches from the root); the shared root stays open.
|
|
119
|
+
await this.level.close();
|
|
84
120
|
}
|
|
85
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Whether this handle has been closed. The provider consults this to evict a
|
|
124
|
+
* cached handle that was closed out-of-band by a consumer (e.g. a StoreTable
|
|
125
|
+
* releasing an index store before a drop) and reopen a fresh one.
|
|
126
|
+
*/
|
|
127
|
+
isClosed() {
|
|
128
|
+
return this.closed;
|
|
129
|
+
}
|
|
86
130
|
async approximateCount(options) {
|
|
87
131
|
this.checkOpen();
|
|
88
|
-
// LevelDB doesn't have a native count, so we iterate and count
|
|
89
|
-
// For large datasets, this could be optimized with sampling
|
|
132
|
+
// LevelDB doesn't have a native count, so we iterate and count.
|
|
133
|
+
// For large datasets, this could be optimized with sampling.
|
|
90
134
|
let count = 0;
|
|
91
135
|
for await (const _ of this.iterate(options)) {
|
|
92
136
|
count++;
|
|
@@ -100,13 +144,14 @@ export class LevelDBStore {
|
|
|
100
144
|
}
|
|
101
145
|
}
|
|
102
146
|
/**
|
|
103
|
-
* WriteBatch implementation
|
|
147
|
+
* WriteBatch implementation over a single abstract-level handle (the array-form
|
|
148
|
+
* `batch()`, which commits atomically within that handle).
|
|
104
149
|
*/
|
|
105
150
|
class LevelDBWriteBatch {
|
|
106
|
-
|
|
151
|
+
level;
|
|
107
152
|
ops = [];
|
|
108
|
-
constructor(
|
|
109
|
-
this.
|
|
153
|
+
constructor(level) {
|
|
154
|
+
this.level = level;
|
|
110
155
|
}
|
|
111
156
|
put(key, value) {
|
|
112
157
|
this.ops.push({ type: 'put', key, value });
|
|
@@ -116,7 +161,7 @@ class LevelDBWriteBatch {
|
|
|
116
161
|
}
|
|
117
162
|
async write() {
|
|
118
163
|
if (this.ops.length > 0) {
|
|
119
|
-
await this.
|
|
164
|
+
await this.level.batch(this.ops);
|
|
120
165
|
this.ops = [];
|
|
121
166
|
}
|
|
122
167
|
}
|
package/dist/src/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/store.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AA4B7C;;GAEG;AACH,MAAM,OAAO,YAAY;IAChB,KAAK,CAAY;IACjB,MAAM,GAAG,KAAK,CAAC;IAEvB,YAAoB,KAAgB;QACnC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAuB;QACxC,MAAM,EAAE,GAAG,IAAI,YAAY,CAAyB,OAAO,CAAC,IAAI,EAAE;YACjE,WAAW,EAAE,MAAM;YACnB,aAAa,EAAE,MAAM;YACrB,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,IAAI;YAChD,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,KAAK;SAC7C,CAAC,CAAC;QAEH,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;QAChB,OAAO,IAAI,YAAY,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,QAAmB;QACtC,OAAO,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAe;QACxB,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,oEAAoE;QACpE,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,C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E,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7C,KAAK,EAAE,CAAC;QACT,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IAEO,SAAS;QAChB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC3C,CAAC;IACF,CAAC;CACD;AAED;;;GAGG;AACH,MAAM,iBAAiB;IACd,KAAK,CAAY;IACjB,GAAG,GAAkB,EAAE,CAAC;IAEhC,YAAY,KAAgB;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAED,GAAG,CAAC,GAAe,EAAE,KAAiB;QACrC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,GAAe;QACrB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,KAAK;QACV,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACjC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACf,CAAC;IACF,CAAC;IAED,KAAK;QACJ,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;IACf,CAAC;CACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quereus/plugin-leveldb",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "LevelDB storage plugin for Quereus - Node.js persistent storage",
|
|
6
6
|
"keywords": [
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@quereus/isolation": "^
|
|
41
|
-
"@quereus/quereus": "^
|
|
42
|
-
"@quereus/store": "^
|
|
40
|
+
"@quereus/isolation": "^4.1.0",
|
|
41
|
+
"@quereus/quereus": "^4.1.0",
|
|
42
|
+
"@quereus/store": "^4.1.0"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"quereus": "^0.24.0"
|
|
@@ -56,14 +56,21 @@
|
|
|
56
56
|
"label": "Base Path",
|
|
57
57
|
"type": "string",
|
|
58
58
|
"default": "./data",
|
|
59
|
-
"help": "
|
|
59
|
+
"help": "Directory of the single shared LevelDB database"
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"key": "createIfMissing",
|
|
63
63
|
"label": "Create If Missing",
|
|
64
64
|
"type": "boolean",
|
|
65
65
|
"default": true,
|
|
66
|
-
"help": "Create
|
|
66
|
+
"help": "Create the database if it doesn't exist"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"key": "syncCommits",
|
|
70
|
+
"label": "Sync Commits",
|
|
71
|
+
"type": "boolean",
|
|
72
|
+
"default": true,
|
|
73
|
+
"help": "fsync each transaction commit so it survives power loss (slower commits when on)"
|
|
67
74
|
},
|
|
68
75
|
{
|
|
69
76
|
"key": "moduleName",
|
|
@@ -88,17 +95,18 @@
|
|
|
88
95
|
"test": "cd ../.. && node --import ./packages/quereus-plugin-leveldb/register.mjs node_modules/mocha/bin/mocha.js \"packages/quereus-plugin-leveldb/test/**/*.spec.ts\" --reporter min --colors"
|
|
89
96
|
},
|
|
90
97
|
"dependencies": {
|
|
91
|
-
"@quereus/quereus": "^
|
|
92
|
-
"@quereus/store": "^
|
|
98
|
+
"@quereus/quereus": "^4.1.0",
|
|
99
|
+
"@quereus/store": "^4.1.0",
|
|
100
|
+
"abstract-level": "^3.1.0",
|
|
93
101
|
"classic-level": "^3.0.0"
|
|
94
102
|
},
|
|
95
103
|
"devDependencies": {
|
|
96
104
|
"@quereus/isolation": "*",
|
|
97
105
|
"@types/mocha": "^10.0.10",
|
|
98
|
-
"@types/node": "^25.
|
|
106
|
+
"@types/node": "^25.9.3",
|
|
99
107
|
"chai": "^6.2.2",
|
|
100
|
-
"mocha": "^11.7.
|
|
101
|
-
"rimraf": "^6.1.
|
|
108
|
+
"mocha": "^11.7.6",
|
|
109
|
+
"rimraf": "^6.1.3",
|
|
102
110
|
"ts-node": "^10.9.2",
|
|
103
111
|
"typescript": "^5.9.3"
|
|
104
112
|
}
|