Skip to content

Commit

Permalink
fix rest being case sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
dragazo committed Sep 20, 2024
1 parent 4451a1d commit a55ce8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extensions/BeatBlox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
if (note.contents !== undefined) return note.contents.map(x => parseNote(x));
if (typeof (note) === 'number' && Number.isInteger(note)) return note;
if (typeof (note) !== 'string' || note === '') throw Error(`expected a note, got '${note}'`);
if (note === 'Rest') return NOTES[note];
if (note.toLowerCase() === 'rest') return NOTES['Rest'];

const v = Number(note);
if (Number.isInteger(v) && note == v) return v;
Expand Down Expand Up @@ -164,7 +164,7 @@
if (note.contents !== undefined) return note.contents.map(x => parseDrumNote(x));
if (typeof (note) === 'number' && Number.isInteger(note)) return note;
if (typeof (note) !== 'string' || note === '') throw Error(`expected a drum note, got '${note}'`);
if (note === 'Rest') return NOTES[note];
if (note.toLowerCase() === 'rest') return NOTES['Rest'];

const res = DRUM_TO_NOTE[note.toLowerCase()];
if (res === undefined) throw Error(`unknown drum sound: "${note}"`);
Expand Down

0 comments on commit a55ce8a

Please sign in to comment.