mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 17:01:00 +03:00
add fixes to multiple documents
This commit is contained in:
@@ -149,27 +149,3 @@ export const getInputVariables = (paramValue: string): string[] => {
|
||||
}
|
||||
return inputVariables
|
||||
}
|
||||
|
||||
/**
|
||||
* Get blob
|
||||
* @param {string} fileBase64Str
|
||||
* @returns {Buffer[]}
|
||||
*/
|
||||
export const getBlob = (fileBase64Str: string) => {
|
||||
let bufferArray: Buffer[] = []
|
||||
let files: string[] = []
|
||||
|
||||
if (fileBase64Str.startsWith('[') && fileBase64Str.endsWith(']')) {
|
||||
files = JSON.parse(fileBase64Str)
|
||||
} else {
|
||||
files = [fileBase64Str]
|
||||
}
|
||||
|
||||
for (const file of files) {
|
||||
const splitDataURI = file.split(',')
|
||||
splitDataURI.pop()
|
||||
const bf = Buffer.from(splitDataURI.pop() || '', 'base64')
|
||||
bufferArray.push(bf)
|
||||
}
|
||||
return bufferArray
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user