Skip to content

Commit

Permalink
Merge pull request #26 from kenty02/feature/ignore-case-for-names
Browse files Browse the repository at this point in the history
授業科目名および担当教員名を検索する際に大文字小文字の違いを無視する
  • Loading branch information
swawa-yu authored Sep 24, 2024
2 parents 638112b + 9f497dd commit 8528522
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ function matchesCampus(subject: Subject2, searchOptions: SearchOptions): boolean
}

function matchesSubjectName(subject: Subject2, searchOptions: SearchOptions): boolean {
return searchOptions.subjectName === "" || subject["授業科目名"].includes(searchOptions.subjectName);
return searchOptions.subjectName === "" || subject["授業科目名"].toLowerCase().includes(searchOptions.subjectName.toLowerCase());
}

function matchesTeacher(subject: Subject2, searchOptions: SearchOptions): boolean {
return searchOptions.teacher === "" || subject["担当教員名"].some(teacher => teacher.includes(searchOptions.teacher));
return searchOptions.teacher === "" || subject["担当教員名"].some(teacher => teacher.toLowerCase().includes(searchOptions.teacher.toLowerCase()));
}

function matchesKamokuKubun(subject: Subject2, searchOptions: SearchOptions): boolean {
Expand Down Expand Up @@ -174,4 +174,4 @@ function matchesRishuNenji(subject: Subject2, searchOptions: SearchOptions): boo

function matchesSubjectCode(subject: Subject2, searchOptions: SearchOptions): boolean {
return subject["講義コード"].startsWith(searchOptions.subjectCode);
}
}

0 comments on commit 8528522

Please sign in to comment.