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

Function customStringify

packages/ui/src/views/chatflows/EmbedChat.jsx:179–192  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

177}
178
179const customStringify = (obj) => {
180 let stringified = JSON.stringify(obj, null, 4)
181 .replace(/"([^"]+)":/g, '$1:')
182 .replace(/: "([^"]+)"/g, (match, value) => (value.includes('<') ? `: "${value}"` : `: '${value}'`))
183 .replace(/: "(true|false|\d+)"/g, ': $1')
184 .replace(/customCSS: ""/g, 'customCSS: ``')
185 return stringified
186 .split('\n')
187 .map((line, index) => {
188 if (index === 0) return line
189 return ' '.repeat(8) + line
190 })
191 .join('\n')
192}
193
194const embedPopupHtmlCodeCustomization = (chatflowid) => {
195 return `<script type="module">

Calls 1

stringifyMethod · 0.80

Tested by

no test coverage detected