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

Function isAllowedUploadMimeType

packages/components/src/utils.ts:1274–1279  ·  view source on GitHub ↗
(mime: string)

Source from the content-addressed store, hash-verified

1272 * @returns {boolean}
1273 */
1274export const isAllowedUploadMimeType = (mime: string): boolean => {
1275 if (!mime || typeof mime !== 'string') return false
1276 const trimmed = mime.trim()
1277 if (!trimmed) return false
1278 return ALLOWED_UPLOAD_MIME_TYPES.has(trimmed) && mapMimeTypeToExt(trimmed) !== ''
1279}
1280
1281// remove invalid markdown image pattern: ![<some-string>](<some-string>)
1282// Uses indexOf instead of a global regex to avoid O(n²) backtracking when the

Callers 1

Calls 1

mapMimeTypeToExtFunction · 0.85

Tested by

no test coverage detected