@keyv/mongo 3.0.5 → 3.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/dist/index.cjs +2 -7
- package/dist/index.js +2 -8
- package/package.json +19 -11
package/dist/index.cjs
CHANGED
|
@@ -253,13 +253,7 @@ var KeyvMongo = class extends import_node_events.default {
|
|
|
253
253
|
async clear() {
|
|
254
254
|
const client = await this.connect;
|
|
255
255
|
if (this.opts.useGridFS) {
|
|
256
|
-
|
|
257
|
-
await client.bucket.drop();
|
|
258
|
-
} catch (error) {
|
|
259
|
-
if (!(error instanceof import_mongodb.MongoServerError && error.code === 26)) {
|
|
260
|
-
throw error;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
256
|
+
await client.bucket.drop();
|
|
263
257
|
}
|
|
264
258
|
await client.store.deleteMany({
|
|
265
259
|
key: { $regex: this.namespace ? `^${this.namespace}:*` : "" }
|
|
@@ -335,3 +329,4 @@ var index_default = KeyvMongo;
|
|
|
335
329
|
0 && (module.exports = {
|
|
336
330
|
KeyvMongo
|
|
337
331
|
});
|
|
332
|
+
/* v8 ignore next -- @preserve */
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import { Buffer } from "buffer";
|
|
|
3
3
|
import EventEmitter from "events";
|
|
4
4
|
import {
|
|
5
5
|
GridFSBucket,
|
|
6
|
-
MongoServerError,
|
|
7
6
|
MongoClient as mongoClient
|
|
8
7
|
} from "mongodb";
|
|
9
8
|
var keyvMongoKeys = /* @__PURE__ */ new Set([
|
|
@@ -222,13 +221,7 @@ var KeyvMongo = class extends EventEmitter {
|
|
|
222
221
|
async clear() {
|
|
223
222
|
const client = await this.connect;
|
|
224
223
|
if (this.opts.useGridFS) {
|
|
225
|
-
|
|
226
|
-
await client.bucket.drop();
|
|
227
|
-
} catch (error) {
|
|
228
|
-
if (!(error instanceof MongoServerError && error.code === 26)) {
|
|
229
|
-
throw error;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
224
|
+
await client.bucket.drop();
|
|
232
225
|
}
|
|
233
226
|
await client.store.deleteMany({
|
|
234
227
|
key: { $regex: this.namespace ? `^${this.namespace}:*` : "" }
|
|
@@ -304,3 +297,4 @@ export {
|
|
|
304
297
|
KeyvMongo,
|
|
305
298
|
index_default as default
|
|
306
299
|
};
|
|
300
|
+
/* v8 ignore next -- @preserve */
|
package/package.json
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keyv/mongo",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "MongoDB storage adapter for Keyv",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/index.
|
|
7
|
-
"module": "dist/index.js",
|
|
8
|
-
"types": "dist/index.d.ts",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"require":
|
|
12
|
-
|
|
11
|
+
"require": {
|
|
12
|
+
"types": "./dist/index.d.cts",
|
|
13
|
+
"default": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"import": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
}
|
|
13
19
|
}
|
|
14
20
|
},
|
|
15
21
|
"repository": {
|
|
@@ -35,16 +41,18 @@
|
|
|
35
41
|
},
|
|
36
42
|
"homepage": "https://github.com/jaredwray/keyv",
|
|
37
43
|
"dependencies": {
|
|
38
|
-
"mongodb": "^
|
|
44
|
+
"mongodb": "^7.0.0"
|
|
39
45
|
},
|
|
40
46
|
"devDependencies": {
|
|
41
|
-
"@biomejs/biome": "^2.
|
|
42
|
-
"
|
|
47
|
+
"@biomejs/biome": "^2.3.10",
|
|
48
|
+
"@vitest/coverage-v8": "^4.0.16",
|
|
49
|
+
"rimraf": "^6.1.2",
|
|
43
50
|
"tsd": "^0.33.0",
|
|
44
|
-
"
|
|
51
|
+
"vitest": "^4.0.16",
|
|
52
|
+
"@keyv/test-suite": "^2.1.2"
|
|
45
53
|
},
|
|
46
54
|
"peerDependencies": {
|
|
47
|
-
"keyv": "^5.5.
|
|
55
|
+
"keyv": "^5.5.5"
|
|
48
56
|
},
|
|
49
57
|
"tsd": {
|
|
50
58
|
"directory": "test"
|