From 6d453f4dfe912c911b0c57eb87a3fb531ea26307 Mon Sep 17 00:00:00 2001 From: reimu Date: Tue, 3 Oct 2023 18:55:42 -0500 Subject: [PATCH] Update slice and error --- src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 38daa3d..45ef804 100644 --- a/src/main.ts +++ b/src/main.ts @@ -100,7 +100,7 @@ function t(notes: string, steps: number): string { if (newPos < 0 || newPos >= keys.length) { throw new Error( `detected key outside of range: ${key}` + - `, at position: ${i};${notes.slice(i - 3, i + 3)}` + `, at position: ${i};${notes.slice(i - 5, i + 5)}` ); } return keys[pos + steps]; @@ -120,7 +120,7 @@ transposeEle.addEventListener("click", () => { const notes = inputEle.value; const steps = parseInt(stepsEle.value, 10); if (isNaN(steps)) { - throw new Error(`Invalid steps: ${stepsEle.value} - ${steps}`); + throw new Error(`Invalid steps: ${stepsEle.value}`); } const result = t(notes, steps); outputEle.value = result;