From 8037abb918fa2dbae87bd3fe3c6fafc8651a362e Mon Sep 17 00:00:00 2001 From: Kyle McNally Date: Wed, 17 Jul 2024 09:50:09 -0400 Subject: [PATCH] parse is deprecated --- source/helper.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/helper.ts b/source/helper.ts index ff6c27e..7bfe4ec 100644 --- a/source/helper.ts +++ b/source/helper.ts @@ -1,10 +1,9 @@ import { https } from "follow-redirects"; import { unlink } from "node:fs"; import { tmpdir } from "node:os"; -import { type UrlWithStringQuery, parse } from "node:url"; import { extract } from "tar-fs"; -interface FollowRedirOptions extends UrlWithStringQuery { +interface FollowRedirOptions extends URL { maxBodyLength: number; } @@ -56,7 +55,7 @@ export const isRunningInAwsLambdaNode20 = () => { export const downloadAndExtract = async (url: string) => new Promise((resolve, reject) => { - const getOptions = parse(url) as FollowRedirOptions; + const getOptions = new URL(url) as FollowRedirOptions; getOptions.maxBodyLength = 60 * 1024 * 1024; // 60mb const destinationDirectory = `${tmpdir()}/chromium-pack`; const extractObject = extract(destinationDirectory);