@upstash/redis 1.23.1 → 1.23.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/commands/xrange.js +16 -17
- package/esm/pkg/pipeline.js +0 -1
- package/esm/version.js +1 -1
- package/package.json +1 -1
- package/script/pkg/commands/xrange.js +16 -17
- package/script/pkg/pipeline.js +0 -1
- package/script/version.js +1 -1
- package/types/version.d.ts +1 -1
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { Command } from "./command.js";
|
|
2
2
|
function deserialize(result) {
|
|
3
|
-
if (result.length === 0) {
|
|
4
|
-
return {};
|
|
5
|
-
}
|
|
6
3
|
const obj = {};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
while (entries.length >= 2) {
|
|
14
|
-
const field = entries.shift();
|
|
15
|
-
const value = entries.shift();
|
|
16
|
-
try {
|
|
17
|
-
obj[streamId][field] = JSON.parse(value);
|
|
4
|
+
for (const e of result) {
|
|
5
|
+
while (e.length >= 2) {
|
|
6
|
+
const streamId = e.shift();
|
|
7
|
+
const entries = e.shift();
|
|
8
|
+
if (!(streamId in obj)) {
|
|
9
|
+
obj[streamId] = {};
|
|
18
10
|
}
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
while (entries.length >= 2) {
|
|
12
|
+
const field = entries.shift();
|
|
13
|
+
const value = entries.shift();
|
|
14
|
+
try {
|
|
15
|
+
obj[streamId][field] = JSON.parse(value);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
obj[streamId][field] = value;
|
|
19
|
+
}
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
22
|
}
|
|
@@ -30,7 +29,7 @@ export class XRangeCommand extends Command {
|
|
|
30
29
|
command.push("COUNT", count);
|
|
31
30
|
}
|
|
32
31
|
super(command, {
|
|
33
|
-
deserialize: (result) => deserialize(result
|
|
32
|
+
deserialize: (result) => deserialize(result),
|
|
34
33
|
...opts,
|
|
35
34
|
});
|
|
36
35
|
}
|
package/esm/pkg/pipeline.js
CHANGED
|
@@ -92,7 +92,6 @@ export class Pipeline {
|
|
|
92
92
|
path,
|
|
93
93
|
body: Object.values(this.commands).map((c) => c.command),
|
|
94
94
|
}));
|
|
95
|
-
console.log("after req", { res });
|
|
96
95
|
return res.map(({ error, result }, i) => {
|
|
97
96
|
if (error) {
|
|
98
97
|
throw new UpstashError(`Command ${i + 1} [ ${this.commands[i].command[0]} ] failed: ${error}`);
|
package/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "v1.23.
|
|
1
|
+
export const VERSION = "v1.23.3";
|
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.23.
|
|
6
|
+
"version": "v1.23.3",
|
|
7
7
|
"description": "An HTTP/REST based Redis client built on top of Upstash REST API.",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -3,24 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.XRangeCommand = void 0;
|
|
4
4
|
const command_js_1 = require("./command.js");
|
|
5
5
|
function deserialize(result) {
|
|
6
|
-
if (result.length === 0) {
|
|
7
|
-
return {};
|
|
8
|
-
}
|
|
9
6
|
const obj = {};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
while (entries.length >= 2) {
|
|
17
|
-
const field = entries.shift();
|
|
18
|
-
const value = entries.shift();
|
|
19
|
-
try {
|
|
20
|
-
obj[streamId][field] = JSON.parse(value);
|
|
7
|
+
for (const e of result) {
|
|
8
|
+
while (e.length >= 2) {
|
|
9
|
+
const streamId = e.shift();
|
|
10
|
+
const entries = e.shift();
|
|
11
|
+
if (!(streamId in obj)) {
|
|
12
|
+
obj[streamId] = {};
|
|
21
13
|
}
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
while (entries.length >= 2) {
|
|
15
|
+
const field = entries.shift();
|
|
16
|
+
const value = entries.shift();
|
|
17
|
+
try {
|
|
18
|
+
obj[streamId][field] = JSON.parse(value);
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
obj[streamId][field] = value;
|
|
22
|
+
}
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
25
|
}
|
|
@@ -33,7 +32,7 @@ class XRangeCommand extends command_js_1.Command {
|
|
|
33
32
|
command.push("COUNT", count);
|
|
34
33
|
}
|
|
35
34
|
super(command, {
|
|
36
|
-
deserialize: (result) => deserialize(result
|
|
35
|
+
deserialize: (result) => deserialize(result),
|
|
37
36
|
...opts,
|
|
38
37
|
});
|
|
39
38
|
}
|
package/script/pkg/pipeline.js
CHANGED
|
@@ -95,7 +95,6 @@ class Pipeline {
|
|
|
95
95
|
path,
|
|
96
96
|
body: Object.values(this.commands).map((c) => c.command),
|
|
97
97
|
}));
|
|
98
|
-
console.log("after req", { res });
|
|
99
98
|
return res.map(({ error, result }, i) => {
|
|
100
99
|
if (error) {
|
|
101
100
|
throw new error_js_1.UpstashError(`Command ${i + 1} [ ${this.commands[i].command[0]} ] failed: ${error}`);
|
package/script/version.js
CHANGED
package/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "v1.23.
|
|
1
|
+
export declare const VERSION = "v1.23.3";
|