MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / sanitizeValue

Function sanitizeValue

packages/server/src/utils/sanitize.util.ts:147–164  ·  view source on GitHub ↗
(value: any, key: string)

Source from the content-addressed store, hash-verified

145 ]
146
147 function sanitizeValue(value: any, key: string): any {
148 const lowerKey = key.toLowerCase()
149 const isSensitive = sensitiveFields.some((field) => lowerKey.includes(field))
150
151 if (isSensitive) {
152 return '********'
153 }
154
155 if (value && typeof value === 'object' && !Array.isArray(value)) {
156 return sanitizeObject(value)
157 }
158
159 if (Array.isArray(value)) {
160 return value.map((item, index) => sanitizeValue(item, `${key}[${index}]`))
161 }
162
163 return value
164 }
165
166 function sanitizeObject(obj: Record<string, any>): Record<string, any> {
167 const result: Record<string, any> = {}

Callers 1

sanitizeObjectFunction · 0.85

Calls 1

sanitizeObjectFunction · 0.70

Tested by

no test coverage detected