mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-14 11:49:16 +00:00
Ensure fetchScripts returns a typed Script array by specifying return type in map function
This commit is contained in:
parent
11197af3e1
commit
810d63ea4d
@ -18,11 +18,11 @@ const fetchScripts = async (): Promise<Script[]> => {
|
|||||||
);
|
);
|
||||||
const files: { download_url: string }[] = await response.json();
|
const files: { download_url: string }[] = await response.json();
|
||||||
const scripts = await Promise.all(
|
const scripts = await Promise.all(
|
||||||
files.map(async (file) => {
|
files.map(async (file): Promise<Script> => {
|
||||||
const response = await fetch(file.download_url);
|
const response = await fetch(file.download_url);
|
||||||
const script = await response.json();
|
const script = await response.json();
|
||||||
return script as Script;
|
return script;
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
return scripts;
|
return scripts;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user