MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / getFiles

Function getFiles

packages/sitemap/src/s3-sync.ts:4–13  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

2import * as path from 'path';
3
4async function getFiles(dir: string): Promise<string | string[]> {
5 const dirents = await fs.readdir(dir, { withFileTypes: true });
6 const files = await Promise.all(
7 dirents.map((dirent) => {
8 const res = path.resolve(dir, dirent.name);
9 return dirent.isDirectory() ? getFiles(res) : res;
10 })
11 );
12 return Array.prototype.concat(...files);
13}
14
15export async function uploadDir(
16 uploadFile: (args: {

Callers 1

uploadDirFunction · 0.85

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected