(fileBase64)
| 528 | } |
| 529 | |
| 530 | export const getFileName = (fileBase64) => { |
| 531 | let fileNames = [] |
| 532 | if (fileBase64.startsWith('FILE-STORAGE::')) { |
| 533 | const names = fileBase64.substring(14) |
| 534 | if (names.includes('[') && names.includes(']')) { |
| 535 | const files = JSON.parse(names) |
| 536 | return files.join(', ') |
| 537 | } else { |
| 538 | return fileBase64.substring(14) |
| 539 | } |
| 540 | } |
| 541 | if (fileBase64.startsWith('[') && fileBase64.endsWith(']')) { |
| 542 | const files = JSON.parse(fileBase64) |
| 543 | for (const file of files) { |
| 544 | const splitDataURI = file.split(',') |
| 545 | const filename = splitDataURI[splitDataURI.length - 1].split(':')[1] |
| 546 | fileNames.push(filename) |
| 547 | } |
| 548 | return fileNames.join(', ') |
| 549 | } else { |
| 550 | const splitDataURI = fileBase64.split(',') |
| 551 | const filename = splitDataURI[splitDataURI.length - 1].split(':')[1] |
| 552 | return filename |
| 553 | } |
| 554 | } |
| 555 | |
| 556 | export const getFolderName = (base64ArrayStr) => { |
| 557 | try { |
no test coverage detected