| 103 | }; |
| 104 | |
| 105 | const parseFilterQuery = (filterQuery: string): FilterValues => { |
| 106 | if (filterQuery === "") { |
| 107 | return {}; |
| 108 | } |
| 109 | |
| 110 | const result: FilterValues = {}; |
| 111 | const keyValuePair = /(\w+):"([^"]+)"|(\w+):(\S+)/g; |
| 112 | |
| 113 | for (const match of filterQuery.matchAll(keyValuePair)) { |
| 114 | const key = match[1] ?? match[3]; |
| 115 | const value = match[2] ?? match[4]; |
| 116 | if (key && value) { |
| 117 | result[key] = value; |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | return result; |
| 122 | }; |
| 123 | |
| 124 | const stringifyFilter = (filterValue: FilterValues): string => { |
| 125 | let result = ""; |