Skip to content

Commit caab5c3

Browse files
Update enums.ts
1 parent 14e9f89 commit caab5c3

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • src/frontend/src/routes/(needs_onboarding)/(navbar_and_footer)/upload

src/frontend/src/routes/(needs_onboarding)/(navbar_and_footer)/upload/enums.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ export enum UploadStage {
44
Stage_3
55
}
66

7+
const uploadStages = new Set<UploadStage>(
8+
Object.values(UploadStage).filter((value): value is UploadStage => typeof value === 'number')
9+
);
10+
711
export const isWhichUploadStage = (value: unknown): value is UploadStage => {
8-
return (
9-
value === UploadStage.Stage_1 || value === UploadStage.Stage_2 || value === UploadStage.Stage_3
10-
);
12+
return typeof value === 'number' && uploadStages.has(value);
1113
};

0 commit comments

Comments
 (0)