MCPcopy
hub / github.com/FlowiseAI/Flowise / findAllConfigValues

Function findAllConfigValues

packages/server/src/utils/buildAgentflow.ts:585–611  ·  view source on GitHub ↗
(obj: any, paramName: string)

Source from the content-addressed store, hash-verified

583
584 // Find all config values (handle arrays)
585 const findAllConfigValues = (obj: any, paramName: string): any[] => {
586 const results: any[] = []
587
588 if (typeof obj !== 'object' || obj === null) {
589 return results
590 }
591
592 // Handle arrays (e.g., agentTools array)
593 if (Array.isArray(obj)) {
594 for (const item of obj) {
595 results.push(...findAllConfigValues(item, paramName))
596 }
597 return results
598 }
599
600 // Direct property match
601 if (Object.prototype.hasOwnProperty.call(obj, paramName)) {
602 results.push(obj[paramName])
603 }
604
605 // Recursively search nested objects
606 for (const value of Object.values(obj)) {
607 results.push(...findAllConfigValues(value, paramName))
608 }
609
610 return results
611 }
612
613 const configValues = findAllConfigValues(paramsObj, configParamName)
614

Callers 1

getParamValuesFunction · 0.85

Calls 1

callMethod · 0.45

Tested by

no test coverage detected