Skip to content

Commit dec0ff0

Browse files
committed
Fix URL on Node <= 9
1 parent 8d37edb commit dec0ff0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { EngineName, EngineParameters } from "./types.ts";
22
import { version } from "../version.ts";
33
import https from "node:https";
44
import qs from "node:querystring";
5+
import url from "node:url";
56
import { RequestTimeoutError } from "./errors.ts";
67

78
/**
@@ -39,7 +40,7 @@ export function extractNextParameters<E extends EngineName = EngineName>(
3940
json["pagination"]?.["next"];
4041

4142
if (nextUrlString) {
42-
const nextUrl = new URL(nextUrlString);
43+
const nextUrl = new url.URL(nextUrlString);
4344
const nextParameters: Record<string, string> = {};
4445
for (const [k, v] of nextUrl.searchParams.entries()) {
4546
if (k === "engine") continue;

0 commit comments

Comments
 (0)