MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / scriptNameFromUrl

Function scriptNameFromUrl

tooling/scripts/perf-web-runtime.mjs:538–547  ·  view source on GitHub ↗
(rawUrl)

Source from the content-addressed store, hash-verified

536}
537
538function 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
549function budgetStatus(label, actual, budget, comparator = (a, b) => a <= b) {
550 const ok = comparator(actual, budget)

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected