@upstash/redis 1.16.1-rc.1 → 1.16.1-rc.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/esm/pkg/http.js CHANGED
@@ -84,7 +84,6 @@ export class HttpClient {
84
84
  throw new UpstashError(body.error);
85
85
  }
86
86
  if (this.options?.responseEncoding === "base64") {
87
- console.log("decoding base64");
88
87
  return Array.isArray(body) ? body.map(decode) : decode(body);
89
88
  }
90
89
  return body;
@@ -105,14 +104,18 @@ function base64decode(b64) {
105
104
  dec = new TextDecoder().decode(bytes);
106
105
  }
107
106
  catch (e) {
108
- console.warn(`Unable to decode base64 [${dec}]: ${e.message}`);
107
+ if (Deno.env.get("UPSTASH_DEBUG")) {
108
+ console.warn(`Unable to decode base64 ${b64}: ${e.message}`);
109
+ }
109
110
  return b64;
110
111
  }
111
112
  try {
112
113
  return decodeURIComponent(dec);
113
114
  }
114
115
  catch (e) {
115
- console.warn(`Unable to decode URI[${dec}]: ${e.message}`);
116
+ if (Deno.env.get("UPSTASH_DEBUG")) {
117
+ console.warn(`Unable to decode URIComponent ${dec}: ${e.message}`);
118
+ }
116
119
  return dec;
117
120
  }
118
121
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "main": "./script/platforms/nodejs.js",
4
4
  "types": "./types/platforms/nodejs.d.ts",
5
5
  "name": "@upstash/redis",
6
- "version": "v1.16.1-rc.1",
6
+ "version": "v1.16.1-rc.3",
7
7
  "description": "An HTTP/REST based Redis client built on top of Upstash REST API.",
8
8
  "repository": {
9
9
  "type": "git",
@@ -87,7 +87,6 @@ class HttpClient {
87
87
  throw new error_js_1.UpstashError(body.error);
88
88
  }
89
89
  if (this.options?.responseEncoding === "base64") {
90
- console.log("decoding base64");
91
90
  return Array.isArray(body) ? body.map(decode) : decode(body);
92
91
  }
93
92
  return body;
@@ -109,14 +108,18 @@ function base64decode(b64) {
109
108
  dec = new TextDecoder().decode(bytes);
110
109
  }
111
110
  catch (e) {
112
- console.warn(`Unable to decode base64 [${dec}]: ${e.message}`);
111
+ if (Deno.env.get("UPSTASH_DEBUG")) {
112
+ console.warn(`Unable to decode base64 ${b64}: ${e.message}`);
113
+ }
113
114
  return b64;
114
115
  }
115
116
  try {
116
117
  return decodeURIComponent(dec);
117
118
  }
118
119
  catch (e) {
119
- console.warn(`Unable to decode URI[${dec}]: ${e.message}`);
120
+ if (Deno.env.get("UPSTASH_DEBUG")) {
121
+ console.warn(`Unable to decode URIComponent ${dec}: ${e.message}`);
122
+ }
120
123
  return dec;
121
124
  }
122
125
  }
@@ -71,7 +71,7 @@ export declare type HttpClientConfig = {
71
71
  export declare class HttpClient implements Requester {
72
72
  baseUrl: string;
73
73
  headers: Record<string, string>;
74
- readonly options?: {
74
+ readonly options: {
75
75
  backend?: string;
76
76
  agent: any;
77
77
  responseEncoding?: false | "base64";