(files: ReadonlyArray<string>, query: string)
| 2160 | }) |
| 2161 | |
| 2162 | const 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 | |
| 2176 | const updateFileState = ( |
| 2177 | state: FileState, |