MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / extractOutputFromArray

Function extractOutputFromArray

packages/components/src/utils.ts:1318–1326  ·  view source on GitHub ↗
(output: any)

Source from the content-addressed store, hash-verified

1316 * @returns {string}
1317 */
1318export const extractOutputFromArray = (output: any): string => {
1319 if (Array.isArray(output)) {
1320 return output.map((o) => o.text).join('\n')
1321 } else if (typeof output === 'object') {
1322 if (output.text) return output.text
1323 else return JSON.stringify(output)
1324 }
1325 return output
1326}
1327
1328/**
1329 * Loop through the object and replace the key with the value

Callers 3

agentNodeFunction · 0.90
agentNodeFunction · 0.90
runMethod · 0.90

Calls 1

stringifyMethod · 0.80

Tested by

no test coverage detected