MCPcopy
hub / github.com/stemdeckapp/stemdeck / normalizeSource

Function normalizeSource

static/js/catalog.js:124–132  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

122}
123
124function normalizeSource(value) {
125 const s = String(value || "").trim();
126 if (!s) return s;
127 // Normalize YouTube URLs to the bare video ID so that youtu.be/xxx,
128 // youtube.com/watch?v=xxx, and variants with &t= / ?si= all match.
129 const yt = s.match(/(?:youtu\.be\/|[?&]v=)([a-zA-Z0-9_-]{11})/);
130 if (yt) return `yt:${yt[1]}`;
131 return s;
132}
133
134function normalizeSearch(value) {
135 return String(value || "").trim().toLowerCase();

Callers 1

findTrackBySourceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected