Function
addSuffixToFile
(fileName: string, suffix: number)
Source from the content-addressed store, hash-verified
| 75 | } |
| 76 | |
| 77 | function addSuffixToFile(fileName: string, suffix: number): string { |
| 78 | const dotIndex = fileName.lastIndexOf('.'); |
| 79 | if (dotIndex === -1) { |
| 80 | return `${fileName}-${suffix}`; |
| 81 | } |
| 82 | return `${fileName.substring(0, dotIndex)}-${suffix}${fileName.substring( |
| 83 | dotIndex |
| 84 | )}`; |
| 85 | } |
| 86 | |
| 87 | export async function ls(dir: string) { |
| 88 | const storageRoot = await getRoot(); |
Tested by
no test coverage detected