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

Function scriptNameFromUrl

tooling/scripts/perf-desktop-runtime.mjs:511–520  ·  view source on GitHub ↗
(rawUrl)

Source from the content-addressed store, hash-verified

509}
510
511function scriptNameFromUrl(rawUrl) {
512 try {
513 const url = new URL(rawUrl)
514 const name = url.pathname.split('/').pop() ?? ''
515 return name.endsWith('.js') ? name : null
516 } catch {
517 const name = String(rawUrl).split('?')[0].split('/').pop() ?? ''
518 return name.endsWith('.js') ? name : null
519 }
520}
521
522function budgetStatus(label, actual, budget) {
523 return {

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected