@upstash/redis 1.0.0-alpha.4 → 1.0.1
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/README.md +256 -0
- package/chunk-2EIGUPGW.mjs +375 -0
- package/{chunk-ZIB6XPPC.mjs → chunk-HGM7M7CJ.mjs} +9 -4
- package/{chunk-6GEVIAL6.mjs → chunk-WPH7MAB2.mjs} +1 -1
- package/cloudflare.d.ts +2 -2
- package/cloudflare.js +248 -667
- package/cloudflare.mjs +2 -2
- package/commands.d.ts +511 -4
- package/commands.js +10 -4
- package/commands.mjs +3 -1
- package/fastly.d.ts +2 -2
- package/fastly.js +248 -667
- package/fastly.mjs +2 -2
- package/index.d.ts +2 -2
- package/index.js +248 -667
- package/index.mjs +3 -3
- package/nodejs.d.ts +2 -2
- package/nodejs.js +248 -667
- package/nodejs.mjs +3 -3
- package/package.json +1 -1
- package/redis-05a33429.d.ts +976 -0
- package/zunionstore-98bb4d18.d.ts +165 -0
- package/chunk-Y5TC4HX2.mjs +0 -798
- package/redis-dd052782.d.ts +0 -962
- package/zunionstore-dffa797d.d.ts +0 -670
package/commands.js
CHANGED
|
@@ -28,6 +28,7 @@ __export(commands_exports, {
|
|
|
28
28
|
BitCountCommand: () => BitCountCommand,
|
|
29
29
|
BitOpCommand: () => BitOpCommand,
|
|
30
30
|
BitPosCommand: () => BitPosCommand,
|
|
31
|
+
Command: () => Command,
|
|
31
32
|
DBSizeCommand: () => DBSizeCommand,
|
|
32
33
|
DecrByCommand: () => DecrByCommand,
|
|
33
34
|
DecrCommand: () => DecrCommand,
|
|
@@ -143,13 +144,17 @@ var UpstashError = class extends Error {
|
|
|
143
144
|
|
|
144
145
|
// pkg/util.ts
|
|
145
146
|
function parseRecursive(obj) {
|
|
146
|
-
|
|
147
|
+
const parsed = Array.isArray(obj) ? obj.map((o) => {
|
|
147
148
|
try {
|
|
148
149
|
return parseRecursive(o);
|
|
149
150
|
} catch {
|
|
150
151
|
return o;
|
|
151
152
|
}
|
|
152
153
|
}) : JSON.parse(obj);
|
|
154
|
+
if (typeof parsed === "number" && parsed.toString() != obj) {
|
|
155
|
+
return obj;
|
|
156
|
+
}
|
|
157
|
+
return parsed;
|
|
153
158
|
}
|
|
154
159
|
function parseResponse(result) {
|
|
155
160
|
try {
|
|
@@ -159,7 +164,7 @@ function parseResponse(result) {
|
|
|
159
164
|
}
|
|
160
165
|
}
|
|
161
166
|
|
|
162
|
-
// pkg/command.ts
|
|
167
|
+
// pkg/commands/command.ts
|
|
163
168
|
var Command = class {
|
|
164
169
|
constructor(command, opts) {
|
|
165
170
|
var _a;
|
|
@@ -439,8 +444,8 @@ var HScanCommand = class extends Command {
|
|
|
439
444
|
|
|
440
445
|
// pkg/commands/hset.ts
|
|
441
446
|
var HSetCommand = class extends Command {
|
|
442
|
-
constructor(key,
|
|
443
|
-
super(["hset", key, field, value]);
|
|
447
|
+
constructor(key, kv) {
|
|
448
|
+
super(["hset", key, ...Object.entries(kv).flatMap(([field, value]) => [field, value])]);
|
|
444
449
|
}
|
|
445
450
|
};
|
|
446
451
|
|
|
@@ -1095,6 +1100,7 @@ module.exports = __toCommonJS(commands_exports);
|
|
|
1095
1100
|
BitCountCommand,
|
|
1096
1101
|
BitOpCommand,
|
|
1097
1102
|
BitPosCommand,
|
|
1103
|
+
Command,
|
|
1098
1104
|
DBSizeCommand,
|
|
1099
1105
|
DecrByCommand,
|
|
1100
1106
|
DecrCommand,
|
package/commands.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
BitCountCommand,
|
|
4
4
|
BitOpCommand,
|
|
5
5
|
BitPosCommand,
|
|
6
|
+
Command,
|
|
6
7
|
DBSizeCommand,
|
|
7
8
|
DecrByCommand,
|
|
8
9
|
DecrCommand,
|
|
@@ -106,13 +107,14 @@ import {
|
|
|
106
107
|
ZScanCommand,
|
|
107
108
|
ZScoreCommand,
|
|
108
109
|
ZUnionStoreCommand
|
|
109
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-HGM7M7CJ.mjs";
|
|
110
111
|
import "./chunk-7YUZYRJS.mjs";
|
|
111
112
|
export {
|
|
112
113
|
AppendCommand,
|
|
113
114
|
BitCountCommand,
|
|
114
115
|
BitOpCommand,
|
|
115
116
|
BitPosCommand,
|
|
117
|
+
Command,
|
|
116
118
|
DBSizeCommand,
|
|
117
119
|
DecrByCommand,
|
|
118
120
|
DecrCommand,
|
package/fastly.d.ts
CHANGED