@keyv/mongo 3.0.1 → 3.0.3

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 CHANGED
@@ -28,16 +28,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
 
30
30
  // src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
33
  KeyvMongo: () => KeyvMongo,
34
- default: () => src_default
34
+ default: () => index_default
35
35
  });
36
- module.exports = __toCommonJS(src_exports);
36
+ module.exports = __toCommonJS(index_exports);
37
37
  var import_events = __toESM(require("events"), 1);
38
38
  var import_buffer = require("buffer");
39
39
  var import_mongodb = require("mongodb");
40
- var keyvMongoKeys = /* @__PURE__ */ new Set(["url", "collection", "namespace", "serialize", "deserialize", "uri", "useGridFS", "dialect"]);
40
+ var keyvMongoKeys = /* @__PURE__ */ new Set(["url", "collection", "namespace", "serialize", "deserialize", "uri", "useGridFS", "dialect", "db"]);
41
41
  var KeyvMongo = class extends import_events.default {
42
42
  ttlSupport = false;
43
43
  opts;
@@ -106,7 +106,6 @@ var KeyvMongo = class extends import_events.default {
106
106
  }
107
107
  } catch (error) {
108
108
  this.emit("error", error);
109
- reject(error);
110
109
  }
111
110
  });
112
111
  }
@@ -296,7 +295,7 @@ var KeyvMongo = class extends import_events.default {
296
295
  await client.mongoClient.close();
297
296
  }
298
297
  };
299
- var src_default = KeyvMongo;
298
+ var index_default = KeyvMongo;
300
299
  // Annotate the CommonJS export names for ESM import in node:
301
300
  0 && (module.exports = {
302
301
  KeyvMongo
package/dist/index.d.cts CHANGED
@@ -42,4 +42,4 @@ declare class KeyvMongo extends EventEmitter implements KeyvStoreAdapter {
42
42
  disconnect(): Promise<void>;
43
43
  }
44
44
 
45
- export { KeyvMongo, KeyvMongo as default };
45
+ export { KeyvMongo, type KeyvMongoOptions, KeyvMongo as default };
package/dist/index.d.ts CHANGED
@@ -42,4 +42,4 @@ declare class KeyvMongo extends EventEmitter implements KeyvStoreAdapter {
42
42
  disconnect(): Promise<void>;
43
43
  }
44
44
 
45
- export { KeyvMongo, KeyvMongo as default };
45
+ export { KeyvMongo, type KeyvMongoOptions, KeyvMongo as default };
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  GridFSBucket,
7
7
  MongoServerError
8
8
  } from "mongodb";
9
- var keyvMongoKeys = /* @__PURE__ */ new Set(["url", "collection", "namespace", "serialize", "deserialize", "uri", "useGridFS", "dialect"]);
9
+ var keyvMongoKeys = /* @__PURE__ */ new Set(["url", "collection", "namespace", "serialize", "deserialize", "uri", "useGridFS", "dialect", "db"]);
10
10
  var KeyvMongo = class extends EventEmitter {
11
11
  ttlSupport = false;
12
12
  opts;
@@ -75,7 +75,6 @@ var KeyvMongo = class extends EventEmitter {
75
75
  }
76
76
  } catch (error) {
77
77
  this.emit("error", error);
78
- reject(error);
79
78
  }
80
79
  });
81
80
  }
@@ -265,8 +264,8 @@ var KeyvMongo = class extends EventEmitter {
265
264
  await client.mongoClient.close();
266
265
  }
267
266
  };
268
- var src_default = KeyvMongo;
267
+ var index_default = KeyvMongo;
269
268
  export {
270
269
  KeyvMongo,
271
- src_default as default
270
+ index_default as default
272
271
  };
package/package.json CHANGED
@@ -1,81 +1,81 @@
1
1
  {
2
- "name": "@keyv/mongo",
3
- "version": "3.0.1",
4
- "description": "MongoDB storage adapter for Keyv",
5
- "type": "module",
6
- "main": "dist/index.cjs",
7
- "module": "dist/index.js",
8
- "types": "dist/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "require": "./dist/index.cjs",
12
- "import": "./dist/index.js"
13
- }
14
- },
15
- "scripts": {
16
- "build": "rm -rf dist && tsup src/index.ts --format cjs,esm --dts --clean",
17
- "prepare": "yarn build",
18
- "test": "xo --fix && vitest run --coverage",
19
- "test:ci": "xo && vitest --run --sequence.setupFiles=list",
20
- "clean": "rm -rf node_modules && rm -rf ./coverage"
21
- },
22
- "xo": {
23
- "rules": {
24
- "import/no-named-as-default": "off",
25
- "unicorn/prefer-module": "off",
26
- "unicorn/prefer-event-target": "off",
27
- "unicorn/no-array-reduce": "off",
28
- "unicorn/prefer-object-from-entries": "off",
29
- "unicorn/prefer-node-protocol": "off",
30
- "@typescript-eslint/no-unsafe-assignment": "off",
31
- "@typescript-eslint/no-unsafe-call": "off",
32
- "@typescript-eslint/no-unsafe-return": "off",
33
- "@typescript-eslint/no-unsafe-argument": "off",
34
- "import/extensions": "off",
35
- "@typescript-eslint/consistent-type-imports": "off",
36
- "@typescript-eslint/naming-convention": "off",
37
- "@typescript-eslint/no-floating-promises": "off",
38
- "import/no-extraneous-dependencies": "off",
39
- "@typescript-eslint/no-confusing-void-expression": "off",
40
- "@typescript-eslint/no-empty-function": "off"
41
- }
42
- },
43
- "repository": {
44
- "type": "git",
45
- "url": "git+https://github.com/jaredwray/keyv.git"
46
- },
47
- "keywords": [
48
- "mongo",
49
- "mongodb",
50
- "keyv",
51
- "storage",
52
- "adapter",
53
- "key",
54
- "value",
55
- "store",
56
- "cache",
57
- "ttl"
58
- ],
59
- "author": "Jared Wray <me@jaredwray.com> (https://jaredwray.com)",
60
- "license": "MIT",
61
- "bugs": {
62
- "url": "https://github.com/jaredwray/keyv/issues"
63
- },
64
- "homepage": "https://github.com/jaredwray/keyv",
65
- "dependencies": {
66
- "mongodb": "^6.8.0"
67
- },
68
- "devDependencies": {
69
- "@keyv/test-suite": "*",
70
- "keyv": "^5.0.0",
71
- "tsd": "^0.31.1",
72
- "xo": "^0.59.3"
73
- },
74
- "tsd": {
75
- "directory": "test"
76
- },
77
- "files": [
78
- "dist",
79
- "LICENSE"
80
- ]
81
- }
2
+ "name": "@keyv/mongo",
3
+ "version": "3.0.3",
4
+ "description": "MongoDB storage adapter for Keyv",
5
+ "type": "module",
6
+ "main": "dist/index.cjs",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "require": "./dist/index.cjs",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "xo": {
16
+ "rules": {
17
+ "import/no-named-as-default": "off",
18
+ "unicorn/prefer-module": "off",
19
+ "unicorn/prefer-event-target": "off",
20
+ "unicorn/no-array-reduce": "off",
21
+ "unicorn/prefer-object-from-entries": "off",
22
+ "unicorn/prefer-node-protocol": "off",
23
+ "@typescript-eslint/no-unsafe-assignment": "off",
24
+ "@typescript-eslint/no-unsafe-call": "off",
25
+ "@typescript-eslint/no-unsafe-return": "off",
26
+ "@typescript-eslint/no-unsafe-argument": "off",
27
+ "import/extensions": "off",
28
+ "@typescript-eslint/consistent-type-imports": "off",
29
+ "@typescript-eslint/naming-convention": "off",
30
+ "@typescript-eslint/no-floating-promises": "off",
31
+ "import/no-extraneous-dependencies": "off",
32
+ "@typescript-eslint/no-confusing-void-expression": "off",
33
+ "@typescript-eslint/no-empty-function": "off"
34
+ }
35
+ },
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "git+https://github.com/jaredwray/keyv.git"
39
+ },
40
+ "keywords": [
41
+ "mongo",
42
+ "mongodb",
43
+ "keyv",
44
+ "storage",
45
+ "adapter",
46
+ "key",
47
+ "value",
48
+ "store",
49
+ "cache",
50
+ "ttl"
51
+ ],
52
+ "author": "Jared Wray <me@jaredwray.com> (https://jaredwray.com)",
53
+ "license": "MIT",
54
+ "bugs": {
55
+ "url": "https://github.com/jaredwray/keyv/issues"
56
+ },
57
+ "homepage": "https://github.com/jaredwray/keyv",
58
+ "dependencies": {
59
+ "mongodb": "^6.8.0"
60
+ },
61
+ "devDependencies": {
62
+ "keyv": "^5.0.0",
63
+ "rimraf": "^6.0.1",
64
+ "tsd": "^0.31.1",
65
+ "xo": "^0.59.3",
66
+ "@keyv/test-suite": "^2.0.7"
67
+ },
68
+ "tsd": {
69
+ "directory": "test"
70
+ },
71
+ "files": [
72
+ "dist",
73
+ "LICENSE"
74
+ ],
75
+ "scripts": {
76
+ "build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
77
+ "test": "xo --fix && vitest run --coverage",
78
+ "test:ci": "xo && vitest --run --sequence.setupFiles=list",
79
+ "clean": "rimraf ./node_modules ./coverage ./dist"
80
+ }
81
+ }