Skip to content

Commit

Permalink
Make DailyLearning.has also be case-insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Jan 12, 2025
1 parent d7d629d commit 770fa2b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hebcal/core",
"version": "5.8.12",
"version": "5.8.13",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"contributors": [
"Eyal Schachter (https://github.com/Scimonster)",
Expand Down
2 changes: 1 addition & 1 deletion src/DailyLearning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class DailyLearning {
* @param name case insensitive
*/
static has(name: string): boolean {
return cals.has(name);
return cals.has(name.toLowerCase());
}

/** Returns the names of all calendars registered */
Expand Down
3 changes: 3 additions & 0 deletions test/DailyLearning.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ test('DailyLearning', () => {
expect(DailyLearning.getCalendars()).toEqual([]);
const dummy = () => {return null};
const hd = new HDate();
expect(DailyLearning.has('Foo')).toBe(false);
DailyLearning.addCalendar('Foo', dummy);
expect(DailyLearning.has('Foo')).toBe(true);
expect(DailyLearning.has('foo')).toBe(true);
DailyLearning.addCalendar('Bar', dummy);
expect(DailyLearning.getCalendars()).toEqual(['foo', 'bar']);
const dummy2 = () => {return {bogus: true}};
Expand Down

0 comments on commit 770fa2b

Please sign in to comment.