Skip to content

Commit 36930ef

Browse files
authored
fix(updater): range block uses the global URL for a path feed root (#96)
Shared range-52w block re-applied: pathToFileURL is wrapped in the global URL, so the IDE type check passes with an older nested @types/node too (found in Amplify).
1 parent 57752a0 commit 36930ef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎scripts/update-data.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3601,7 +3601,7 @@ export function range52wMetrics(headers: string[], rows: unknown[]): Range52w {
36013601
export async function withRange52w<T>(feedRoot: URL | string, funds: T[]): Promise<T[]> {
36023602
const fs = await import('node:fs/promises');
36033603
const { pathToFileURL } = await import('node:url');
3604-
const root = feedRoot instanceof URL ? new URL(feedRoot.href.replace(/\/?$/, '/')) : pathToFileURL(String(feedRoot).replace(/\/?$/, '/'));
3604+
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)
36053605
const out: T[] = [];
36063606
for (const fund of Array.isArray(funds) ? funds : []) {
36073607
const row = fund as unknown as Record<string, unknown>;

0 commit comments

Comments
 (0)