(files: string[], root: string)
| 71 | } |
| 72 | |
| 73 | async function mapFiles(files: string[], root: string) { |
| 74 | if (!files.length) return [] |
| 75 | |
| 76 | const result: string[] = [] |
| 77 | const globs: string[] = [] |
| 78 | for (const file of files) { |
| 79 | if (isDynamicPattern(file)) { |
| 80 | globs.push(file) |
| 81 | } else { |
| 82 | if (path.isAbsolute(file)) { |
| 83 | result.push(file) |
| 84 | } else { |
| 85 | result.push(path.resolve(root, file)) |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | if (globs.length) { |
| 90 | result.push( |
| 91 | ...(await glob(globs, { |
| 92 | absolute: true, |
| 93 | cwd: root, |
| 94 | expandDirectories: false, |
| 95 | ignore: ['**/.git/**', '**/node_modules/**'], |
| 96 | })), |
| 97 | ) |
| 98 | } |
| 99 | return result |
| 100 | } |
no test coverage detected