(dir: string)
| 24 | return Effect.fn("effa-cli.extractExportMappings.service")(function*(cwd: string) { |
| 25 | // @effect-diagnostics-next-line effectFnOpportunity:off |
| 26 | const findTsFiles = (dir: string): Effect.Effect<string[], PlatformError.PlatformError> => |
| 27 | Effect.gen(function*() { |
| 28 | const entries = yield* fs.readDirectory(dir) |
| 29 | |
| 30 | const results = yield* Effect.all( |
| 31 | entries.map(Effect.fnUntraced(function*(entry) { |
| 32 | const fullPath = path.join(dir, entry) |
| 33 | const stat = yield* fs.stat(fullPath) |
| 34 | |
| 35 | if (stat.type === "Directory") { |
| 36 | return yield* findTsFiles(fullPath) |
| 37 | } else if (entry.endsWith(".ts") && !entry.includes(".test.")) { |
| 38 | return [fullPath] |
| 39 | } |
| 40 | return [] |
| 41 | })) |
| 42 | ) |
| 43 | |
| 44 | return EffectArray.flatten(results) |
| 45 | }) |
| 46 | |
| 47 | const srcDir = path.join(cwd, "src") |
| 48 |
no test coverage detected
searching dependent graphs…