(rawUrl)
| 536 | } |
| 537 | |
| 538 | function scriptNameFromUrl(rawUrl) { |
| 539 | try { |
| 540 | const url = new URL(rawUrl) |
| 541 | const name = url.pathname.split('/').pop() ?? '' |
| 542 | return name.endsWith('.js') ? name : null |
| 543 | } catch { |
| 544 | const name = String(rawUrl).split('?')[0].split('/').pop() ?? '' |
| 545 | return name.endsWith('.js') ? name : null |
| 546 | } |
| 547 | } |
| 548 | |
| 549 | function budgetStatus(label, actual, budget, comparator = (a, b) => a <= b) { |
| 550 | const ok = comparator(actual, budget) |