(items: JsdelivrFile[])
| 363 | } |
| 364 | |
| 365 | export function getJsdelivrTotalSize(items: JsdelivrFile[]): number { |
| 366 | let total = 0; |
| 367 | for (const item of items) { |
| 368 | if (item.type === "file" && item.size) { |
| 369 | total += item.size; |
| 370 | } else if (item.type === "directory" && item.files) { |
| 371 | total += getJsdelivrTotalSize(item.files); |
| 372 | } |
| 373 | } |
| 374 | return total; |
| 375 | } |
| 376 | |
| 377 | export async function estimateZipSize( |
| 378 | ref: RepoRef, |