| 26 | } |
| 27 | |
| 28 | function expandFilePaths(filePaths: string[] | string): string[] { |
| 29 | const expandedFilePaths = []; |
| 30 | |
| 31 | for (const filePath of typeof filePaths === 'string' |
| 32 | ? [filePaths] |
| 33 | : filePaths) { |
| 34 | if (fg.isDynamicPattern(filePath)) { |
| 35 | const matchingFilePaths = fg.sync(filePath, {onlyFiles: true}); |
| 36 | expandedFilePaths.push(...matchingFilePaths); |
| 37 | } else { |
| 38 | expandedFilePaths.push(filePath); |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | return expandedFilePaths; |
| 43 | } |
| 44 | |
| 45 | function getMeta(metaPath: string) { |
| 46 | if (fs.existsSync(metaPath)) { |