From 19873c653f885502df24fca5bc36dffbf4558ab7 Mon Sep 17 00:00:00 2001 From: Hanif Dwy Putra S Date: Sun, 16 Oct 2022 12:22:23 +0000 Subject: [PATCH] fix(core.utils): fix matchCustomDownload undefined urls Signed-off-by: Hanif Dwy Putra S --- packages/core/src/utils/extractor.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/src/utils/extractor.ts b/packages/core/src/utils/extractor.ts index 2147384..37715b0 100644 --- a/packages/core/src/utils/extractor.ts +++ b/packages/core/src/utils/extractor.ts @@ -77,7 +77,8 @@ export const matchCustomDownload = ( .slice(0, -1) + url.slice(0, -3), ); - return [links.find((x) => x)!].concat(urls as string[]); + if (!urls?.length) return []; + return [links[0]].concat(urls as string[]); }; export const deObfuscateSaveFromScript = (scriptContent: string): string => {