Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ jobs:
working-directory: examples/cloudflare-workers

- name: Deploy
run: wrangler publish
run: wrangler deploy
working-directory: examples/cloudflare-workers
env:
CLOUDFLARE_API_TOKEN: ${{secrets.CF_API_TOKEN}}
Expand Down Expand Up @@ -409,7 +409,7 @@ jobs:
working-directory: examples/cloudflare-workers-with-typescript

- name: Deploy
run: wrangler publish
run: wrangler deploy
working-directory: examples/cloudflare-workers-with-typescript
env:
CLOUDFLARE_API_TOKEN: ${{secrets.CF_API_TOKEN}}
Expand Down
6 changes: 3 additions & 3 deletions pkg/commands/hgetall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ function deserialize<TData extends Record<string, unknown>>(result: string[]): T
return null;
}
const obj: Record<string, unknown> = {};
while (result.length >= 2) {
const key = result.shift()!;
const value = result.shift()!;
for (let i = 0; i < result.length; i += 2) {
const key = result[i];
const value = result[i + 1];
try {
// handle unsafe integer
const valueIsNumberAndNotSafeInteger =
Expand Down
6 changes: 3 additions & 3 deletions pkg/commands/hrandfield.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ function deserialize<TData extends Record<string, unknown>>(result: string[]): T
return null;
}
const obj: Record<string, unknown> = {};
while (result.length >= 2) {
const key = result.shift()!;
const value = result.shift()!;
for (let i = 0; i < result.length; i += 2) {
const key = result[i];
const value = result[i + 1];
try {
obj[key] = JSON.parse(value);
} catch {
Expand Down
12 changes: 6 additions & 6 deletions pkg/commands/xrange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ function deserialize<TData extends Record<string, Record<string, unknown>>>(
): TData {
const obj: Record<string, Record<string, unknown>> = {};
for (const e of result) {
while (e.length >= 2) {
const streamId = e.shift() as string;
const entries = e.shift()!;
for (let i = 0; i < e.length; i += 2) {
const streamId = e[i] as string;
const entries = e[i + 1];

if (!(streamId in obj)) {
obj[streamId] = {};
}
while (entries.length >= 2) {
const field = (entries as string[]).shift()!;
const value = (entries as string[]).shift()!;
for (let j = 0; j < entries.length; j += 2) {
const field = (entries as string[])[j];
const value = (entries as string[])[j + 1];

try {
obj[streamId][field] = JSON.parse(value);
Expand Down
12 changes: 6 additions & 6 deletions pkg/commands/xrevrange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ function deserialize<TData extends Record<string, Record<string, unknown>>>(
): TData {
const obj: Record<string, Record<string, unknown>> = {};
for (const e of result) {
while (e.length >= 2) {
const streamId = e.shift() as string;
const entries = e.shift()!;
for (let i = 0; i < e.length; i += 2) {
const streamId = e[i] as string;
const entries = e[i + 1];

if (!(streamId in obj)) {
obj[streamId] = {};
}
while (entries.length >= 2) {
const field = (entries as string[]).shift()!;
const value = (entries as string[]).shift()!;
for (let j = 0; j < entries.length; j += 2) {
const field = (entries as string[])[j];
const value = (entries as string[])[j + 1];

try {
obj[streamId][field] = JSON.parse(value);
Expand Down
2 changes: 1 addition & 1 deletion platforms/nodejs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export class Redis extends core.Redis {
if (!url) {
console.warn("[Upstash Redis] Unable to find environment variable: `UPSTASH_REDIS_REST_URL`");
}

// @ts-ignore process will be defined in node
const token = process.env.UPSTASH_REDIS_REST_TOKEN || process.env.KV_REST_API_TOKEN;
if (!token) {
Expand Down
Loading