Skip to content

Commit

Permalink
fix: apply review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ejcheng committed Dec 4, 2024
1 parent 284e544 commit 40d0383
Showing 1 changed file with 10 additions and 30 deletions.
40 changes: 10 additions & 30 deletions src/data/colleges/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { AdvisorGroup } from '../../tools/advisors/types';
import { lastNameRange, lastNameRanges } from '../../tools/advisors/checkers';

const engineeringLiberalArtsGroups: Record<string, string[]> = {
const engineeringLiberalArtsGroups: string[][] = Object.values({
'Group 1': [
'CA-AAP',
'CA-AG',
Expand Down Expand Up @@ -43,7 +43,7 @@ const engineeringLiberalArtsGroups: Record<string, string[]> = {
],
'Group 5': ['FL-AAP', 'FL-AG'],
'Group 6': ['CE-EN'],
};
});

const engineeringRequirements: readonly CollegeOrMajorRequirement[] = [
{
Expand Down Expand Up @@ -129,7 +129,7 @@ const engineeringRequirements: readonly CollegeOrMajorRequirement[] = [
'https://www.engineering.cornell.edu/students/undergraduate-students/advising/liberal-studies',
checker: [
(course: Course): boolean =>
Object.values(engineeringLiberalArtsGroups).some(group =>
engineeringLiberalArtsGroups.some(group =>
group.some(distribution => hasCategory(course, distribution) ?? false)
) || courseIsForeignLang(course),
],
Expand All @@ -139,40 +139,20 @@ const engineeringRequirements: readonly CollegeOrMajorRequirement[] = [
additionalRequirements: {
'Courses must be from 3 groups.': {
checker: [
(course: Course): boolean =>
engineeringLiberalArtsGroups['Group 1'].some(
distribution => hasCategory(course, distribution) ?? false
),
(course: Course): boolean =>
engineeringLiberalArtsGroups['Group 2'].some(
distribution => hasCategory(course, distribution) ?? false
),
(course: Course): boolean =>
engineeringLiberalArtsGroups['Group 3'].some(
distribution => hasCategory(course, distribution) ?? false
),
(course: Course): boolean =>
engineeringLiberalArtsGroups['Group 4'].some(
distribution => hasCategory(course, distribution) ?? false
),
(course: Course): boolean =>
engineeringLiberalArtsGroups['Group 5'].some(
distribution => hasCategory(course, distribution) ?? false
),
(course: Course): boolean =>
engineeringLiberalArtsGroups['Group 6'].some(
distribution => hasCategory(course, distribution) ?? false
),
...engineeringLiberalArtsGroups.map(group => {

Check failure on line 142 in src/data/colleges/en.ts

View workflow job for this annotation

GitHub Actions / check

Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`
return (course: Course): boolean =>
group.some(distribution => hasCategory(course, distribution) ?? false);
}),
],
fulfilledBy: 'courses',
perSlotMinCount: [1, 1, 1, 1, 1, 1],
slotNames: Object.keys(engineeringLiberalArtsGroups),
slotNames: ['Group 1', 'Group 2', 'Group 3', 'Group 4', 'Group 5', 'Group 6'],
minNumberOfSlots: 3,
},
'Courses must have at least 18 credits.': {
checker: [
(course: Course): boolean =>
Object.values(engineeringLiberalArtsGroups).some(group =>
engineeringLiberalArtsGroups.some(group =>
group.some(distribution => hasCategory(course, distribution) ?? false)
) || courseIsForeignLang(course),
],
Expand All @@ -185,7 +165,7 @@ const engineeringRequirements: readonly CollegeOrMajorRequirement[] = [
const { catalogNbr } = course;
return (
!ifCodeMatch(catalogNbr, '1***') &&
(Object.values(engineeringLiberalArtsGroups).some(group =>
(engineeringLiberalArtsGroups.some(group =>
group.some(distribution => hasCategory(course, distribution) ?? false)
) ||
courseIsForeignLang(course))
Expand Down

0 comments on commit 40d0383

Please sign in to comment.