Fix some type skullduggery.
This commit is contained in:
parent
f2a844c3b5
commit
f7b84ca7ea
|
@ -455,19 +455,18 @@ export function splitFiltersArray(filters: LegacyFilter[]) {
|
||||||
* Legacy support remains for the old **SearchFilter[]** format.
|
* Legacy support remains for the old **SearchFilter[]** format.
|
||||||
* These will be migrated to an appropriate **SearchFilters** object, if encountered
|
* These will be migrated to an appropriate **SearchFilters** object, if encountered
|
||||||
*/
|
*/
|
||||||
export function buildQuery(filter: undefined): undefined
|
|
||||||
export function buildQuery(
|
|
||||||
filter: UISearchFilter | LegacyFilter[]
|
|
||||||
): SearchFilters
|
|
||||||
export function buildQuery(
|
export function buildQuery(
|
||||||
filter?: UISearchFilter | LegacyFilter[]
|
filter?: UISearchFilter | LegacyFilter[]
|
||||||
): SearchFilters | undefined {
|
): SearchFilters {
|
||||||
if (!filter) {
|
if (!filter) {
|
||||||
return
|
return {}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Array.isArray(filter)) {
|
if (Array.isArray(filter)) {
|
||||||
filter = processSearchFilters(filter) ?? []
|
filter = processSearchFilters(filter)
|
||||||
|
if (!filter) {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const operator = logicalOperatorFromUI(
|
const operator = logicalOperatorFromUI(
|
||||||
|
|
|
@ -139,11 +139,6 @@ export function isSupportedUserSearch(query: SearchFilters) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export function processSearchFilters(filterArray: undefined): undefined
|
|
||||||
export function processSearchFilters(filterArray: []): undefined
|
|
||||||
export function processSearchFilters(
|
|
||||||
filterArray: LegacyFilter[]
|
|
||||||
): Required<UISearchFilter>
|
|
||||||
export function processSearchFilters(
|
export function processSearchFilters(
|
||||||
filterArray?: LegacyFilter[]
|
filterArray?: LegacyFilter[]
|
||||||
): Required<UISearchFilter> | undefined {
|
): Required<UISearchFilter> | undefined {
|
||||||
|
|
Loading…
Reference in New Issue