Thanks to visit codestin.com
Credit goes to github.com

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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ examples/**/pnpm-lock.yaml

# Local Netlify folder
.netlify
x/
4 changes: 4 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/commands/zrange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class ZRangeCommand<TData extends unknown[]> extends Command<
if (
typeof opts?.count !== "undefined" && typeof opts?.offset !== "undefined"
) {
command.push("limit", opts.offset, opts.count);
command.push("limit", opts!.offset, opts!.count);
}
if (opts?.withScores) {
command.push("withscores");
Expand Down
9 changes: 9 additions & 0 deletions platforms/node_with_fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ import "isomorphic-fetch";
// import http from "http";
// import "isomorphic-fetch";

/**
* Workaround for nodejs 14, where atob is not included in the standardlib
*/
if (typeof atob === "undefined") {
global.atob = function (b64: string) {
return Buffer.from(b64, "base64").toString("utf-8");
};
}

export type { Requester, UpstashRequest, UpstashResponse };

/**
Expand Down
9 changes: 9 additions & 0 deletions platforms/nodejs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ import {
} from "../pkg/http.ts";
import { VERSION } from "../version.ts";

/**
* Workaround for nodejs 14, where atob is not included in the standardlib
*/
if (typeof atob === "undefined") {
global.atob = function (b64: string) {
return Buffer.from(b64, "base64").toString("utf-8");
};
}

export type { Requester, UpstashRequest, UpstashResponse };

/**
Expand Down