(files: ReadonlyArray<string>, query: string)
| 2322 | }) |
| 2323 | |
| 2324 | const 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 | |
| 2338 | const updateFileState = ( |
| 2339 | state: FileState, |