diff --git a/scripts/update-data.ts b/scripts/update-data.ts index 60789d03..d4628467 100755 --- a/scripts/update-data.ts +++ b/scripts/update-data.ts @@ -3601,7 +3601,7 @@ export function range52wMetrics(headers: string[], rows: unknown[]): Range52w { export async function withRange52w(feedRoot: URL | string, funds: T[]): Promise { const fs = await import('node:fs/promises'); const { pathToFileURL } = await import('node:url'); - const root = feedRoot instanceof URL ? new URL(feedRoot.href.replace(/\/?$/, '/')) : pathToFileURL(String(feedRoot).replace(/\/?$/, '/')); + const root = feedRoot instanceof URL ? new URL(feedRoot.href.replace(/\/?$/, '/')) : new URL(pathToFileURL(String(feedRoot).replace(/\/?$/, '/')).href); // global URL, also with older @types/node (Amplify) const out: T[] = []; for (const fund of Array.isArray(funds) ? funds : []) { const row = fund as unknown as Record;