You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we have a union of multiple objects, all of them have a type property, we cannot check the type property because of the union with an array. And the value itself will never be an array, it just needs to be checked with each possible value:
example:
exporttypeRangeFilter={type: "filter_range";id: string;displayName: string;min: number;max: number;step?: number|undefined;minSelected?: number|undefined;maxSelected?: number|undefined;};exporttypeSelectFilterValue={label: string;value: string;selected?: boolean|undefined;productCount?: number|undefined;};exporttypeSelectFilter={id: string;displayName: string;values: Array<SelectFilterValue>};exporttypeSingleSelectFilter={type: "filter_single_select"}&SelectFilter;exporttypeMultiSelectFilter={type: "filter_multi_select"}&SelectFilter;exporttypeFilters=|RangeFilter|SingleSelectFilter|MultiSelectFilter|Array<RangeFilter|SingleSelectFilter|MultiSelectFilter>;// wrong, it will never be an array, it can only be one of the objects, or something that matches multiple objects at the same time.
Although the generation part might be complicated and blow up too fast, maybe I'm going over the top, but I think the correct type needs to address every possible combination:
When we have a union of multiple objects, all of them have a type property, we cannot check the type property because of the union with an array. And the value itself will never be an array, it just needs to be checked with each possible value:
example:
Although the generation part might be complicated and blow up too fast, maybe I'm going over the top, but I think the correct type needs to address every possible combination:
The text was updated successfully, but these errors were encountered: