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

Function safeThumb

static/mobile/app.js:109–111  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

107// gradient + initial. The URL is constrained to a clean https URL so it can't
108// break out of the CSS url().
109function safeThumb(url) {
110 return typeof url === "string" && /^https:\/\/[^"'()\\\s]+$/.test(url) ? url : "";
111}
112function artStyle(card) {
113 const g = (card && card.gradient) || DEFAULT_GRADIENT;
114 const t = card && safeThumb(card.thumb);

Callers 2

artStyleFunction · 0.85
artLabelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected