fix: safe mergeBackendParameters
This commit is contained in:
@@ -354,15 +354,18 @@ export const mergeBackendParameters = (
|
|||||||
baseParams: string[] = [],
|
baseParams: string[] = [],
|
||||||
priorityParams: string[] = []
|
priorityParams: string[] = []
|
||||||
): string[] => {
|
): string[] => {
|
||||||
|
const safeBase = baseParams || [];
|
||||||
|
const safePriority = priorityParams || [];
|
||||||
|
|
||||||
const priorityKeys = new Set(
|
const priorityKeys = new Set(
|
||||||
priorityParams.map((param) => getBackendParameterKey(param))
|
safePriority.map((param) => getBackendParameterKey(param))
|
||||||
);
|
);
|
||||||
|
|
||||||
const filteredBase = baseParams.filter(
|
const filteredBase = safeBase.filter(
|
||||||
(param) => !priorityKeys.has(getBackendParameterKey(param))
|
(param) => !priorityKeys.has(getBackendParameterKey(param))
|
||||||
);
|
);
|
||||||
|
|
||||||
return [...filteredBase, ...priorityParams];
|
return [...filteredBase, ...safePriority];
|
||||||
};
|
};
|
||||||
|
|
||||||
export const modelLabels = [
|
export const modelLabels = [
|
||||||
|
|||||||
Reference in New Issue
Block a user