diff --git a/packages/types/surveys/types.ts b/packages/types/surveys/types.ts index 3407437def..ef8c780953 100644 --- a/packages/types/surveys/types.ts +++ b/packages/types/surveys/types.ts @@ -2009,7 +2009,8 @@ const validateActions = ( return undefined; }); - return actionIssues.filter((issue) => issue !== undefined); + const filteredActionIssues = actionIssues.filter((issue) => issue !== undefined); + return filteredActionIssues; }; const validateLogic = (survey: TSurvey, questionIndex: number, logic: TSurveyLogic[]): z.ZodIssue[] => { diff --git a/packages/types/surveys/validation.ts b/packages/types/surveys/validation.ts index a34c549b6d..0097bcda1c 100644 --- a/packages/types/surveys/validation.ts +++ b/packages/types/surveys/validation.ts @@ -233,7 +233,7 @@ export const findQuestionsWithCyclicLogic = (questions: TSurveyQuestion[]): stri // Helper function to find all "jumpToQuestion" actions in the logic const findJumpToQuestionActions = (actions: TSurveyLogicAction[]): TActionJumpToQuestion[] => { - return actions.filter((action) => action.objective === "jumpToQuestion"); + return actions.filter((action): action is TActionJumpToQuestion => action.objective === "jumpToQuestion"); }; // function to validate hidden field or question id