fork of hey-api/openapi-ts because I need some additional things
1import fs from 'node:fs';
2import path from 'node:path';
3
4export const getFilePaths = (dirPath: string): Array<string> => {
5 let filePaths: Array<string> = [];
6 const files = fs.readdirSync(dirPath);
7
8 for (const file of files) {
9 const filePath = path.join(dirPath, file);
10 const stat = fs.statSync(filePath);
11
12 if (stat.isDirectory()) {
13 filePaths = filePaths.concat(getFilePaths(filePath));
14 } else {
15 filePaths.push(filePath);
16 }
17 }
18
19 return filePaths;
20};
21
22export const getSpecsPath = (): string => path.join(__dirname, '..', '..', 'specs');