Skip to content

Commit

Permalink
explicitly define buffer from node types
Browse files Browse the repository at this point in the history
Signed-off-by: chinodesuuu <chinodesuuu@gmail.com>
  • Loading branch information
sr229 committed Aug 27, 2024
1 parent 932df35 commit 8337224
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/sagiri.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as nodeFetch from "node-fetch";
import type { IOptions } from "./interfaces";
import { env } from "node:process";
import { Buffer } from "node:buffer";
import { Readable } from "node:stream";
import { createReadStream } from "node:fs";
import FormData from "form-data";
Expand All @@ -9,8 +10,9 @@ import { SagiriClientError, SagiriServerError } from "./errors";
import type { IResponse, IResult } from "./response";
import sites from "./sites";

let fetchFn;
// compatibility with older versions of nodejs. This will be removed in the future once LTS versions of nodejs has moved above 21.x
let fetchFn;

if (globalThis.fetch === undefined) {
fetchFn = nodeFetch.default;
} else {
Expand Down

0 comments on commit 8337224

Please sign in to comment.