construct-hub 0.3.224 → 0.3.225

Sign up to get free protection for your applications and to get access to all the features.
@@ -309,7 +309,7 @@ class ConstructHub extends core_1.Construct {
309
309
  }
310
310
  exports.ConstructHub = ConstructHub;
311
311
  _a = JSII_RTTI_SYMBOL_1;
312
- ConstructHub[_a] = { fqn: "construct-hub.ConstructHub", version: "0.3.224" };
312
+ ConstructHub[_a] = { fqn: "construct-hub.ConstructHub", version: "0.3.225" };
313
313
  /**
314
314
  * (experimental) How possibly risky operations (such as doc-generation, which requires installing the indexed packages in order to trans-literate sample code) are isolated to mitigate possible arbitrary code execution vulnerabilities in and around `npm install` or the transliterator's use of the TypeScript compiler.
315
315
  *
@@ -2149,6 +2149,9 @@ var require_src3 = __commonJS({
2149
2149
  "use strict";
2150
2150
  var EventEmitter = require("events");
2151
2151
  var JSONB = require_json_buffer();
2152
+ BigInt.prototype.toJSON = function() {
2153
+ return this.toString();
2154
+ };
2152
2155
  var loadStore = (options) => {
2153
2156
  const adapters = {
2154
2157
  redis: "@keyv/redis",
@@ -2157,7 +2160,8 @@ var require_src3 = __commonJS({
2157
2160
  sqlite: "@keyv/sqlite",
2158
2161
  postgresql: "@keyv/postgres",
2159
2162
  postgres: "@keyv/postgres",
2160
- mysql: "@keyv/mysql"
2163
+ mysql: "@keyv/mysql",
2164
+ etcd: "@keyv/etcd"
2161
2165
  };
2162
2166
  if (options.adapter || options.uri) {
2163
2167
  const adapter = options.adapter || /^[^:]*/.exec(options.uri)[0];
@@ -2189,7 +2193,7 @@ var require_src3 = __commonJS({
2189
2193
  const keyPrefixed = this._getKeyPrefix(key);
2190
2194
  const { store } = this.opts;
2191
2195
  return Promise.resolve().then(() => store.get(keyPrefixed)).then((data) => typeof data === "string" ? this.opts.deserialize(data) : data).then((data) => {
2192
- if (data === void 0) {
2196
+ if (data === void 0 || data === null) {
2193
2197
  return void 0;
2194
2198
  }
2195
2199
  if (typeof data.expires === "number" && Date.now() > data.expires) {
@@ -2210,6 +2214,9 @@ var require_src3 = __commonJS({
2210
2214
  const { store } = this.opts;
2211
2215
  return Promise.resolve().then(() => {
2212
2216
  const expires = typeof ttl === "number" ? Date.now() + ttl : null;
2217
+ if (typeof value === "symbol") {
2218
+ this.emit("error", "symbol cannot be serialized");
2219
+ }
2213
2220
  value = { value, expires };
2214
2221
  return this.opts.serialize(value);
2215
2222
  }).then((value2) => store.set(keyPrefixed, value2, ttl)).then(() => true);