MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / searchNodeList

Function searchNodeList

packages/frontend/src/structure.tsx:124–135  ·  view source on GitHub ↗
(query: string)

Source from the content-addressed store, hash-verified

122 const isSearched = s.createSelector(searchResult, (node: debug.NodeID, o) => !!o && o.includes(node))
123
124 function searchNodeList(query: string): debug.NodeID[] | undefined {
125 if (!query) return setSearchResult()
126 return s.untrack(() => {
127 const result: debug.NodeID[] = []
128 const rgx = new RegExp('^' + query, 'i')
129 for (const node of state().nodeList) {
130 if (node.type !== debug.NodeType.Element && node.name && node.name.match(rgx))
131 result.push(node.id)
132 }
133 return setSearchResult(result.length ? result : undefined)
134 })
135 }
136
137 // SEARCH NODES
138 let lastSearch: string = ''

Callers 1

searchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…