MCPcopy
hub / github.com/pinokiocomputer/pinokio / normalizePinokioInjectTargetRegistrations

Function normalizePinokioInjectTargetRegistrations

full.js:1979–2000  ·  view source on GitHub ↗
(targets)

Source from the content-addressed store, hash-verified

1977}
1978
1979const normalizePinokioInjectTargetRegistrations = (targets) => {
1980 const values = Array.isArray(targets) ? targets : []
1981 const normalized = []
1982 for (const target of values) {
1983 if (!target || typeof target !== 'object' || Array.isArray(target)) {
1984 continue
1985 }
1986 const name = typeof target.name === 'string' ? target.name.trim() : ''
1987 const src = normalizeInspectorUrl(typeof target.src === 'string' ? target.src.trim() : '')
1988 if (!name && !src) {
1989 continue
1990 }
1991 normalized.push({
1992 name,
1993 src,
1994 inject: Array.isArray(target.inject)
1995 ? target.inject.map((entry) => normalizePinokioInjectDescriptor(entry)).filter(Boolean)
1996 : []
1997 })
1998 }
1999 return normalized
2000}
2001
2002const findFramePath = (frame, target, trail = []) => {
2003 if (!frame || !target) {

Callers 1

Calls 2

normalizeInspectorUrlFunction · 0.85

Tested by

no test coverage detected