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

Function filterFiles

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

Source from the content-addressed store, hash-verified

2160})
2161
2162const filterFiles = (files: ReadonlyArray<string>, query: string) => {
2163 if (query.length === 0) {
2164 return files
2165 }
2166 const normalizedQuery = query.toLowerCase()
2167 const filtered: Array<string> = []
2168 for (let index = 0; index < files.length; index++) {
2169 if (files[index].toLowerCase().includes(normalizedQuery)) {
2170 filtered.push(files[index])
2171 }
2172 }
2173 return filtered
2174}
2175
2176const updateFileState = (
2177 state: FileState,

Callers 1

updateFileStateFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected