(
uploadFile: (args: {
Key: string;
Body: any;
CacheControl?: string;
}) => Promise<any>,
s3Path: string
)
| 13 | } |
| 14 | |
| 15 | export async function uploadDir( |
| 16 | uploadFile: (args: { |
| 17 | Key: string; |
| 18 | Body: any; |
| 19 | CacheControl?: string; |
| 20 | }) => Promise<any>, |
| 21 | s3Path: string |
| 22 | ) { |
| 23 | const files = (await getFiles(s3Path)) as string[]; |
| 24 | const uploads = files.map(async (filePath) => |
| 25 | uploadFile({ |
| 26 | Key: path.relative(s3Path, filePath), |
| 27 | Body: createReadStream(filePath), |
| 28 | CacheControl: 'max-age=86400', |
| 29 | }) |
| 30 | ); |
| 31 | return Promise.all(uploads); |
| 32 | } |
no test coverage detected