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

Function getAllValuesFromJson

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

Source from the content-addressed store, hash-verified

1913 * @returns {any[]}
1914 */
1915export const getAllValuesFromJson = (obj: any): any[] => {
1916 const values: any[] = []
1917
1918 function extractValues(data: any) {
1919 if (typeof data === 'object' && data !== null) {
1920 if (Array.isArray(data)) {
1921 for (const item of data) {
1922 extractValues(item)
1923 }
1924 } else {
1925 for (const key in data) {
1926 extractValues(data[key])
1927 }
1928 }
1929 } else {
1930 values.push(data)
1931 }
1932 }
1933
1934 extractValues(obj)
1935 return values
1936}
1937
1938/**
1939 * Get only essential flow data items for telemetry

Callers 1

isStartNodeDependOnInputFunction · 0.85

Calls 1

extractValuesFunction · 0.85

Tested by

no test coverage detected