(rootPath: string)
| 8 | */ |
| 9 | export const filterNode = |
| 10 | (rootPath: string) => |
| 11 | (pattern: string, option: WorksheetFolderNode): boolean => { |
| 12 | const keyword = pattern.trim().toLowerCase(); |
| 13 | if (option.key === rootPath || !keyword) { |
| 14 | return true; |
| 15 | } |
| 16 | return option.label?.toLowerCase().includes(keyword) ?? false; |
| 17 | }; |