@graphql-mesh/cache-redis 0.11.5 → 0.11.6-alpha-20230123163856-e724c9657

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/cjs/index.js CHANGED
@@ -10,6 +10,7 @@ function interpolateStrWithEnv(str) {
10
10
  }
11
11
  class RedisCache {
12
12
  constructor(options) {
13
+ var _a, _b, _c;
13
14
  if (options.url) {
14
15
  const redisUrl = new URL(interpolateStrWithEnv(options.url));
15
16
  redisUrl.searchParams.set('lazyConnect', 'true');
@@ -18,12 +19,12 @@ class RedisCache {
18
19
  if (!['redis:', 'rediss:'].includes(redisUrl.protocol)) {
19
20
  throw new Error('Redis URL must use either redis:// or rediss://');
20
21
  }
21
- this.client = new ioredis_1.default(redisUrl.toString());
22
+ this.client = new ioredis_1.default(redisUrl === null || redisUrl === void 0 ? void 0 : redisUrl.toString());
22
23
  }
23
24
  else {
24
- const parsedHost = interpolateStrWithEnv(options.host);
25
- const parsedPort = interpolateStrWithEnv(options.port);
26
- const parsedPassword = interpolateStrWithEnv(options.password);
25
+ const parsedHost = interpolateStrWithEnv((_a = options.host) === null || _a === void 0 ? void 0 : _a.toString());
26
+ const parsedPort = interpolateStrWithEnv((_b = options.port) === null || _b === void 0 ? void 0 : _b.toString());
27
+ const parsedPassword = interpolateStrWithEnv((_c = options.password) === null || _c === void 0 ? void 0 : _c.toString());
27
28
  if (parsedHost) {
28
29
  this.client = new ioredis_1.default({
29
30
  host: parsedHost,
package/esm/index.js CHANGED
@@ -7,6 +7,7 @@ function interpolateStrWithEnv(str) {
7
7
  }
8
8
  export default class RedisCache {
9
9
  constructor(options) {
10
+ var _a, _b, _c;
10
11
  if (options.url) {
11
12
  const redisUrl = new URL(interpolateStrWithEnv(options.url));
12
13
  redisUrl.searchParams.set('lazyConnect', 'true');
@@ -15,12 +16,12 @@ export default class RedisCache {
15
16
  if (!['redis:', 'rediss:'].includes(redisUrl.protocol)) {
16
17
  throw new Error('Redis URL must use either redis:// or rediss://');
17
18
  }
18
- this.client = new Redis(redisUrl.toString());
19
+ this.client = new Redis(redisUrl === null || redisUrl === void 0 ? void 0 : redisUrl.toString());
19
20
  }
20
21
  else {
21
- const parsedHost = interpolateStrWithEnv(options.host);
22
- const parsedPort = interpolateStrWithEnv(options.port);
23
- const parsedPassword = interpolateStrWithEnv(options.password);
22
+ const parsedHost = interpolateStrWithEnv((_a = options.host) === null || _a === void 0 ? void 0 : _a.toString());
23
+ const parsedPort = interpolateStrWithEnv((_b = options.port) === null || _b === void 0 ? void 0 : _b.toString());
24
+ const parsedPassword = interpolateStrWithEnv((_c = options.password) === null || _c === void 0 ? void 0 : _c.toString());
24
25
  if (parsedHost) {
25
26
  this.client = new Redis({
26
27
  host: parsedHost,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-mesh/cache-redis",
3
- "version": "0.11.5",
3
+ "version": "0.11.6-alpha-20230123163856-e724c9657",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "graphql": "*"