add fixes to multiple documents

This commit is contained in:
Henry
2023-05-15 20:06:22 +01:00
parent 9f53111aac
commit 324bd3a430
6 changed files with 128 additions and 78 deletions
-24
View File
@@ -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
}