MCPcopy Index your code
hub / github.com/anomalyco/opencode / themePreloadHash

Function themePreloadHash

packages/opencode/src/server/shared/ui.ts:15–17  ·  view source on GitHub ↗
(body: string)

Source from the content-addressed store, hash-verified

13export const DEFAULT_CSP = csp()
14
15export function themePreloadHash(body: string) {
16 return body.match(/<script\b(?![^>]*\bsrc\s*=)[^>]*\bid=(['"])oc-theme-preload-script\1[^>]*>([\s\S]*?)<\/script>/i)
17}
18
19export function cspForHtml(body: string) {
20 const match = themePreloadHash(body)

Callers 1

cspForHtmlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected