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

Function getAssetScripts

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

Source from the content-addressed store, hash-verified

9 const nonce = router.options.ssr?.nonce
10
11 const getAssetScripts = (matches: Array<AnyRouteMatch>) => {
12 const assetScripts: Array<RouterManagedTag> = []
13 const manifest = router.ssr?.manifest
14
15 if (!manifest) {
16 return []
17 }
18
19 for (const match of matches) {
20 const scripts = manifest.routes[match.routeId]?.scripts
21
22 if (!scripts) {
23 continue
24 }
25
26 for (const asset of scripts) {
27 assetScripts.push({
28 tag: 'script',
29 attrs: { ...asset.attrs, nonce },
30 children: asset.children,
31 })
32 }
33 }
34
35 return assetScripts
36 }
37
38 const getScripts = (matches: Array<AnyRouteMatch>): Array<RouterManagedTag> =>
39 (

Callers 1

ScriptsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected