keyv 4.2.9 → 4.3.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.
Files changed (2) hide show
  1. package/package.json +4 -1
  2. package/src/index.js +3 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keyv",
3
- "version": "4.2.9",
3
+ "version": "4.3.0",
4
4
  "description": "Simple key-value storage with support for multiple backends",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -8,6 +8,9 @@
8
8
  "coverage": "nyc report --reporter=text-lcov > coverage.lcov",
9
9
  "clean": "rm -rf node_modules && rm -rf .nyc_output && rm -rf coverage.lcov && rm -rf ./test/testdb.sqlite"
10
10
  },
11
+ "workspaces": [
12
+ "packages/test-suite"
13
+ ],
11
14
  "xo": {
12
15
  "rules": {
13
16
  "unicorn/prefer-module": 0,
package/src/index.js CHANGED
@@ -7,6 +7,7 @@ const compressBrotli = require('compress-brotli');
7
7
  const loadStore = options => {
8
8
  const adapters = {
9
9
  redis: '@keyv/redis',
10
+ rediss: '@keyv/redis',
10
11
  mongodb: '@keyv/mongo',
11
12
  mongo: '@keyv/mongo',
12
13
  sqlite: '@keyv/sqlite',
@@ -35,7 +36,7 @@ const iterableAdapters = [
35
36
  ];
36
37
 
37
38
  class Keyv extends EventEmitter {
38
- constructor(uri, options) {
39
+ constructor(uri, {emitErrors = true, ...options} = {}) {
39
40
  super();
40
41
  this.opts = {
41
42
  namespace: 'keyv',
@@ -59,7 +60,7 @@ class Keyv extends EventEmitter {
59
60
  };
60
61
  }
61
62
 
62
- if (typeof this.opts.store.on === 'function') {
63
+ if (typeof this.opts.store.on === 'function' && emitErrors) {
63
64
  this.opts.store.on('error', error => this.emit('error', error));
64
65
  }
65
66