MCPcopy Create free account
hub / github.com/Effect-TS/effect / filterFiles

Function filterFiles

packages/effect/src/cli/Prompt.ts:2324–2336  ·  view source on GitHub ↗
(files: ReadonlyArray<string>, query: string)

Source from the content-addressed store, hash-verified

2322})
2323
2324const filterFiles = (files: ReadonlyArray<string>, query: string) => {
2325 if (query.length === 0) {
2326 return files
2327 }
2328 const normalizedQuery = query.toLowerCase()
2329 const filtered: Array<string> = []
2330 for (let index = 0; index < files.length; index++) {
2331 if (files[index].toLowerCase().includes(normalizedQuery)) {
2332 filtered.push(files[index])
2333 }
2334 }
2335 return filtered
2336}
2337
2338const updateFileState = (
2339 state: FileState,

Callers 1

updateFileStateFunction · 0.85

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected