MCPcopy Create free account
hub / github.com/effect-app/libs / findTsFiles

Function findTsFiles

packages/cli/src/extract.ts:26–45  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

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

Callers 1

extract.tsFile · 0.85

Calls 3

joinMethod · 0.80
statMethod · 0.80
mapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…