MCPcopy Create free account
hub / github.com/DavidWells/analytics / getVariableDetails

Function getVariableDetails

scripts/docs/parse/index.js:202–222  ·  view source on GitHub ↗
(body, variableName)

Source from the content-addressed store, hash-verified

200}
201
202function getVariableDetails(body, variableName) {
203 return body.filter((node) => {
204 if (node.type === 'VariableDeclaration') {
205 return true
206 }
207 return false
208 }).reduce((acc, node) => {
209 const { declarations } = node
210 // console.log('declarations', declarations)
211 if (declarations) {
212 declarations.forEach((dec) => {
213 if (getName(dec) === variableName) {
214 if (dec.init && dec.init.properties) {
215 acc = acc.concat(dec.init.properties)
216 }
217 }
218 })
219 }
220 return acc
221 }, [])
222}
223
224function getFunctionDetails(body, functionName) {
225 return body.filter((node) => {

Callers 1

getMethodsReturnedFunction · 0.85

Calls 1

getNameFunction · 0.70

Tested by

no test coverage detected