MCPcopy Create free account
hub / github.com/TanStack/router / getScripts

Function getScripts

packages/solid-router/src/Scripts.tsx:38–54  ·  view source on GitHub ↗
(matches: Array<AnyRouteMatch>)

Source from the content-addressed store, hash-verified

36 }
37
38 const getScripts = (matches: Array<AnyRouteMatch>): Array<RouterManagedTag> =>
39 (
40 matches
41 .map((match) => match.scripts!)
42 .flat(1)
43 .filter(Boolean) as Array<RouterManagedTag>
44 ).map(
45 ({ children, ...script }) =>
46 ({
47 tag: 'script',
48 attrs: {
49 ...script,
50 nonce,
51 },
52 children,
53 }) satisfies RouterManagedTag,
54 )
55
56 const activeMatches = Solid.createMemo(() => router.stores.matches.get())
57 const assetScripts = Solid.createMemo(() => getAssetScripts(activeMatches()))

Callers 1

ScriptsFunction · 0.70

Calls 1

filterMethod · 0.80

Tested by

no test coverage detected