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

Function getAllValuesFromJson

packages/server/src/utils/index.ts:1924–1945  ·  view source on GitHub ↗
(obj: any)

Source from the content-addressed store, hash-verified

1922 * @returns {any[]}
1923 */
1924export const getAllValuesFromJson = (obj: any): any[] => {
1925 const values: any[] = []
1926
1927 function extractValues(data: any) {
1928 if (typeof data === 'object' && data !== null) {
1929 if (Array.isArray(data)) {
1930 for (const item of data) {
1931 extractValues(item)
1932 }
1933 } else {
1934 for (const key in data) {
1935 extractValues(data[key])
1936 }
1937 }
1938 } else {
1939 values.push(data)
1940 }
1941 }
1942
1943 extractValues(obj)
1944 return values
1945}
1946
1947/**
1948 * Get only essential flow data items for telemetry

Callers 1

isStartNodeDependOnInputFunction · 0.85

Calls 1

extractValuesFunction · 0.85

Tested by

no test coverage detected