descript-redis-cache 4.0.4 → 4.0.5

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/build/index.js +8 -11
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -10,14 +10,11 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
10
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
11
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
12
  };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
13
  var _Cache_instances, _Cache_client, _Cache_logger, _Cache_options, _Cache_normalizeKey, _Cache_log;
17
14
  Object.defineProperty(exports, "__esModule", { value: true });
18
15
  exports.EVENT = exports.Cache = void 0;
19
16
  const node_crypto_1 = require("node:crypto");
20
- const descript_1 = __importDefault(require("descript"));
17
+ const descript_1 = require("descript");
21
18
  const ioredis_1 = require("ioredis");
22
19
  class Cache {
23
20
  constructor(options, logger) {
@@ -70,7 +67,7 @@ class Cache {
70
67
  total: totalTimer,
71
68
  },
72
69
  });
73
- reject(descript_1.default.error({
70
+ reject((0, descript_1.error)({
74
71
  id: EVENT.REDIS_CACHE_READ_TIMEOUT,
75
72
  }));
76
73
  }, __classPrivateFieldGet(this, _Cache_options, "f").readTimeout);
@@ -92,7 +89,7 @@ class Cache {
92
89
  total: totalTimer,
93
90
  },
94
91
  });
95
- reject(descript_1.default.error({
92
+ reject((0, descript_1.error)({
96
93
  id: EVENT.REDIS_CACHE_READ_ERROR,
97
94
  }));
98
95
  }
@@ -107,7 +104,7 @@ class Cache {
107
104
  total: totalTimer,
108
105
  },
109
106
  });
110
- reject(descript_1.default.error({
107
+ reject((0, descript_1.error)({
111
108
  id: EVENT.REDIS_CACHE_READ_KEY_NOT_FOUND,
112
109
  }));
113
110
  }
@@ -129,7 +126,7 @@ class Cache {
129
126
  total: totalTimer,
130
127
  },
131
128
  });
132
- reject(descript_1.default.error({
129
+ reject((0, descript_1.error)({
133
130
  id: EVENT.REDIS_CACHE_JSON_PARSING_FAILED,
134
131
  }));
135
132
  return;
@@ -178,7 +175,7 @@ class Cache {
178
175
  total: totalTimer,
179
176
  },
180
177
  });
181
- reject(descript_1.default.error({
178
+ reject((0, descript_1.error)({
182
179
  id: EVENT.REDIS_CACHE_JSON_STRINGIFY_FAILED,
183
180
  }));
184
181
  return;
@@ -199,7 +196,7 @@ class Cache {
199
196
  total: totalTimer,
200
197
  },
201
198
  });
202
- reject(descript_1.default.error({
199
+ reject((0, descript_1.error)({
203
200
  id: EVENT.REDIS_CACHE_WRITE_ERROR,
204
201
  }));
205
202
  }
@@ -213,7 +210,7 @@ class Cache {
213
210
  total: totalTimer,
214
211
  },
215
212
  });
216
- reject(descript_1.default.error({
213
+ reject((0, descript_1.error)({
217
214
  id: EVENT.REDIS_CACHE_WRITE_FAILED,
218
215
  }));
219
216
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "descript-redis-cache",
3
- "version": "4.0.4",
3
+ "version": "4.0.5",
4
4
  "description": "plugin for descript to use redis as cache",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",