From 4da4827bcbcdd1ef163f635d9b29416ff272b0bb Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Mon, 27 Nov 2023 12:48:14 -0500 Subject: Add JSDoc type annotations to project (rebased) --- test/data/anki-note-builder-test-results.json | 48 ++-- test/data/html/test-document2-script.js | 40 +++- test/data/translator-test-results-note-data1.json | 280 +++++++++++----------- test/data/translator-test-results.json | 236 +++++++++--------- 4 files changed, 319 insertions(+), 285 deletions(-) (limited to 'test/data') diff --git a/test/data/anki-note-builder-test-results.json b/test/data/anki-note-builder-test-results.json index b752e878..49542e39 100644 --- a/test/data/anki-note-builder-test-results.json +++ b/test/data/anki-note-builder-test-results.json @@ -194,7 +194,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打つ", - "frequencies": "", + "frequencies": "", "furigana": "つ", "furigana-plain": "打[う]つ", "glossary": "
(vt, Test Dictionary 2)
", @@ -224,7 +224,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打つ", - "frequencies": "", + "frequencies": "", "furigana": "つ", "furigana-plain": "打[ぶ]つ", "glossary": "
(vt, Test Dictionary 2)
", @@ -379,7 +379,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打ち込む", - "frequencies": "", + "frequencies": "", "furigana": "む", "furigana-plain": "打[う]ち 込[こ]む", "glossary": "
(vt, Test Dictionary 2)
", @@ -409,7 +409,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打ち込む", - "frequencies": "", + "frequencies": "", "furigana": "む", "furigana-plain": "打[ぶ]ち 込[こ]む", "glossary": "
(vt, Test Dictionary 2)
", @@ -499,7 +499,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打つ", - "frequencies": "", + "frequencies": "", "furigana": "つ", "furigana-plain": "打[う]つ", "glossary": "
(vt, Test Dictionary 2)
", @@ -529,7 +529,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打つ", - "frequencies": "", + "frequencies": "", "furigana": "つ", "furigana-plain": "打[ぶ]つ", "glossary": "
(vt, Test Dictionary 2)
", @@ -759,7 +759,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打つ", - "frequencies": "", + "frequencies": "", "furigana": "つ", "furigana-plain": "打[う]つ", "glossary": "
(vt, Test Dictionary 2)
", @@ -824,7 +824,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打つ", - "frequencies": "", + "frequencies": "", "furigana": "つ", "furigana-plain": "打[ぶ]つ", "glossary": "
(vt, Test Dictionary 2)
", @@ -889,7 +889,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打ち込む", - "frequencies": "", + "frequencies": "", "furigana": "む", "furigana-plain": "打[う]ち 込[こ]む", "glossary": "
(vt, Test Dictionary 2)
", @@ -949,7 +949,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打つ", - "frequencies": "", + "frequencies": "", "furigana": "つ", "furigana-plain": "打[う]つ", "glossary": "
(vt, Test Dictionary 2)
", @@ -1014,7 +1014,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打ち込む", - "frequencies": "", + "frequencies": "", "furigana": "む", "furigana-plain": "打[ぶ]ち 込[こ]む", "glossary": "
(vt, Test Dictionary 2)
", @@ -1074,7 +1074,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打つ", - "frequencies": "", + "frequencies": "", "furigana": "つ", "furigana-plain": "打[ぶ]つ", "glossary": "
(vt, Test Dictionary 2)
", @@ -1526,7 +1526,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打ち込む", - "frequencies": "", + "frequencies": "", "furigana": "む", "furigana-plain": "打[う]ち 込[こ]む", "glossary": "
(vt, Test Dictionary 2)
", @@ -1556,7 +1556,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打ち込む", - "frequencies": "", + "frequencies": "", "furigana": "む", "furigana-plain": "打[ぶ]ち 込[こ]む", "glossary": "
(vt, Test Dictionary 2)
", @@ -1646,7 +1646,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打つ", - "frequencies": "", + "frequencies": "", "furigana": "つ", "furigana-plain": "打[う]つ", "glossary": "
(vt, Test Dictionary 2)
", @@ -1676,7 +1676,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打つ", - "frequencies": "", + "frequencies": "", "furigana": "つ", "furigana-plain": "打[ぶ]つ", "glossary": "
(vt, Test Dictionary 2)
", @@ -1831,7 +1831,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打ち込む", - "frequencies": "", + "frequencies": "", "furigana": "む", "furigana-plain": "打[う]ち 込[こ]む", "glossary": "
(vt, Test Dictionary 2)
", @@ -1861,7 +1861,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打ち込む", - "frequencies": "", + "frequencies": "", "furigana": "む", "furigana-plain": "打[ぶ]ち 込[こ]む", "glossary": "
(vt, Test Dictionary 2)
", @@ -1951,7 +1951,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打つ", - "frequencies": "", + "frequencies": "", "furigana": "つ", "furigana-plain": "打[う]つ", "glossary": "
(vt, Test Dictionary 2)
", @@ -1981,7 +1981,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打つ", - "frequencies": "", + "frequencies": "", "furigana": "つ", "furigana-plain": "打[ぶ]つ", "glossary": "
(vt, Test Dictionary 2)
", @@ -2136,7 +2136,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打ち込む", - "frequencies": "", + "frequencies": "", "furigana": "む", "furigana-plain": "打[う]ち 込[こ]む", "glossary": "
(vt, Test Dictionary 2)
", @@ -2166,7 +2166,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打ち込む", - "frequencies": "", + "frequencies": "", "furigana": "む", "furigana-plain": "打[ぶ]ち 込[こ]む", "glossary": "
(vt, Test Dictionary 2)
", @@ -2256,7 +2256,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打つ", - "frequencies": "", + "frequencies": "", "furigana": "つ", "furigana-plain": "打[う]つ", "glossary": "
(vt, Test Dictionary 2)
", @@ -2286,7 +2286,7 @@ "dictionary": "Test Dictionary 2", "document-title": "title", "expression": "打つ", - "frequencies": "", + "frequencies": "", "furigana": "つ", "furigana-plain": "打[ぶ]つ", "glossary": "
(vt, Test Dictionary 2)
", diff --git a/test/data/html/test-document2-script.js b/test/data/html/test-document2-script.js index 8a183019..5a6ad4d1 100644 --- a/test/data/html/test-document2-script.js +++ b/test/data/html/test-document2-script.js @@ -16,40 +16,65 @@ * along with this program. If not, see . */ +/** + * @param {Element} element + */ function requestFullscreen(element) { if (element.requestFullscreen) { element.requestFullscreen(); + // @ts-ignore - Browser compatibility } else if (element.mozRequestFullScreen) { + // @ts-ignore - Browser compatibility element.mozRequestFullScreen(); + // @ts-ignore - Browser compatibility } else if (element.webkitRequestFullscreen) { + // @ts-ignore - Browser compatibility element.webkitRequestFullscreen(); + // @ts-ignore - Browser compatibility } else if (element.msRequestFullscreen) { + // @ts-ignore - Browser compatibility element.msRequestFullscreen(); } } +/** */ function exitFullscreen() { if (document.exitFullscreen) { document.exitFullscreen(); + // @ts-ignore - Browser compatibility } else if (document.mozCancelFullScreen) { + // @ts-ignore - Browser compatibility document.mozCancelFullScreen(); + // @ts-ignore - Browser compatibility } else if (document.webkitExitFullscreen) { + // @ts-ignore - Browser compatibility document.webkitExitFullscreen(); + // @ts-ignore - Browser compatibility } else if (document.msExitFullscreen) { + // @ts-ignore - Browser compatibility document.msExitFullscreen(); } } +/** + * @returns {?Element} + */ function getFullscreenElement() { return ( document.fullscreenElement || + // @ts-ignore - Browser compatibility document.msFullscreenElement || + // @ts-ignore - Browser compatibility document.mozFullScreenElement || + // @ts-ignore - Browser compatibility document.webkitFullscreenElement || null ); } +/** + * @param {Element} element + */ function toggleFullscreen(element) { if (getFullscreenElement()) { exitFullscreen(); @@ -58,6 +83,10 @@ function toggleFullscreen(element) { } } +/** + * @param {HTMLElement|DocumentFragment} container + * @param {?Element} [fullscreenElement] + */ function setup(container, fullscreenElement=null) { const fullscreenLink = container.querySelector('.fullscreen-link'); if (fullscreenLink !== null) { @@ -65,6 +94,7 @@ function setup(container, fullscreenElement=null) { fullscreenElement = container.querySelector('.fullscreen-element'); } fullscreenLink.addEventListener('click', (e) => { + if (fullscreenElement === null) { return; } toggleFullscreen(fullscreenElement); e.preventDefault(); return false; @@ -74,11 +104,15 @@ function setup(container, fullscreenElement=null) { const template = container.querySelector('template'); const templateContentContainer = container.querySelector('.template-content-container'); if (template !== null && templateContentContainer !== null) { - const mode = container.dataset.shadowMode; - const shadow = templateContentContainer.attachShadow({mode}); + const mode = (container instanceof HTMLElement ? container.dataset.shadowMode : void 0); + const shadow = templateContentContainer.attachShadow({ + mode: (mode === 'open' || mode === 'closed' ? mode : 'open') + }); const containerStyles = document.querySelector('#container-styles'); - shadow.appendChild(containerStyles.cloneNode(true)); + if (containerStyles !== null) { + shadow.appendChild(containerStyles.cloneNode(true)); + } const content = document.importNode(template.content, true); setup(content); diff --git a/test/data/translator-test-results-note-data1.json b/test/data/translator-test-results-note-data1.json index d686563c..34f7c21a 100644 --- a/test/data/translator-test-results-note-data1.json +++ b/test/data/translator-test-results-note-data1.json @@ -1659,7 +1659,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 0 + "frequency": "sixteen" }, { "index": 4, @@ -1672,7 +1672,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 22 + "frequency": "twenty-two (22)" }, { "index": 5, @@ -1791,7 +1791,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 0 + "frequency": "sixteen" }, { "index": 4, @@ -1804,7 +1804,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 22 + "frequency": "twenty-two (22)" }, { "index": 5, @@ -1963,7 +1963,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 0 + "frequency": "seventeen" }, { "index": 4, @@ -1976,7 +1976,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 23 + "frequency": "twenty-three (23)" }, { "index": 5, @@ -1989,7 +1989,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 29 + "frequency": "twenty-nine" } ], "pitches": [], @@ -2095,7 +2095,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 0 + "frequency": "seventeen" }, { "index": 4, @@ -2108,7 +2108,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 23 + "frequency": "twenty-three (23)" }, { "index": 5, @@ -2121,7 +2121,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 29 + "frequency": "twenty-nine" } ], "pitches": [], @@ -3651,7 +3651,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -3677,7 +3677,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 0 + "frequency": "eighteen" }, { "index": 4, @@ -3690,7 +3690,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 24 + "frequency": "twenty-four (24)" }, { "index": 5, @@ -3813,7 +3813,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -3839,7 +3839,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 0 + "frequency": "eighteen" }, { "index": 4, @@ -3852,7 +3852,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 24 + "frequency": "twenty-four (24)" }, { "index": 5, @@ -4045,7 +4045,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -4071,7 +4071,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 0 + "frequency": "nineteen" }, { "index": 4, @@ -4084,7 +4084,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 25 + "frequency": "twenty-five (25)" }, { "index": 5, @@ -4097,7 +4097,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 31 + "frequency": "thirty-one" } ], "pitches": [ @@ -4207,7 +4207,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -4233,7 +4233,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 0 + "frequency": "nineteen" }, { "index": 4, @@ -4246,7 +4246,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 25 + "frequency": "twenty-five (25)" }, { "index": 5, @@ -4259,7 +4259,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 31 + "frequency": "thirty-one" } ], "pitches": [ @@ -5079,7 +5079,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 0 + "frequency": "sixteen" }, { "index": 4, @@ -5092,7 +5092,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 22 + "frequency": "twenty-two (22)" }, { "index": 5, @@ -5211,7 +5211,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 0 + "frequency": "sixteen" }, { "index": 4, @@ -5224,7 +5224,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 22 + "frequency": "twenty-two (22)" }, { "index": 5, @@ -5385,7 +5385,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 0 + "frequency": "seventeen" }, { "index": 4, @@ -5398,7 +5398,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 23 + "frequency": "twenty-three (23)" }, { "index": 5, @@ -5411,7 +5411,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 29 + "frequency": "twenty-nine" } ], "pitches": [], @@ -5517,7 +5517,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 0 + "frequency": "seventeen" }, { "index": 4, @@ -5530,7 +5530,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 23 + "frequency": "twenty-three (23)" }, { "index": 5, @@ -5543,7 +5543,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 29 + "frequency": "twenty-nine" } ], "pitches": [], @@ -7394,7 +7394,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 0 + "frequency": "sixteen" }, { "index": 4, @@ -7407,7 +7407,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 22 + "frequency": "twenty-two (22)" }, { "index": 5, @@ -7526,7 +7526,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 0 + "frequency": "sixteen" }, { "index": 4, @@ -7539,7 +7539,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 22 + "frequency": "twenty-two (22)" }, { "index": 5, @@ -8007,7 +8007,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 0 + "frequency": "seventeen" }, { "index": 4, @@ -8020,7 +8020,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 23 + "frequency": "twenty-three (23)" }, { "index": 5, @@ -8033,7 +8033,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 29 + "frequency": "twenty-nine" } ], "pitches": [], @@ -8139,7 +8139,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 0 + "frequency": "seventeen" }, { "index": 4, @@ -8152,7 +8152,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 23 + "frequency": "twenty-three (23)" }, { "index": 5, @@ -8165,7 +8165,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 29 + "frequency": "twenty-nine" } ], "pitches": [], @@ -8684,7 +8684,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -8710,7 +8710,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 0 + "frequency": "eighteen" }, { "index": 4, @@ -8723,7 +8723,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 24 + "frequency": "twenty-four (24)" }, { "index": 5, @@ -8846,7 +8846,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -8872,7 +8872,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 0 + "frequency": "eighteen" }, { "index": 4, @@ -8885,7 +8885,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 24 + "frequency": "twenty-four (24)" }, { "index": 5, @@ -9412,7 +9412,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 0 + "frequency": "sixteen" }, { "index": 4, @@ -9425,7 +9425,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 22 + "frequency": "twenty-two (22)" }, { "index": 5, @@ -9544,7 +9544,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 0 + "frequency": "sixteen" }, { "index": 4, @@ -9557,7 +9557,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 22 + "frequency": "twenty-two (22)" }, { "index": 5, @@ -10089,7 +10089,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -10115,7 +10115,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 0 + "frequency": "nineteen" }, { "index": 4, @@ -10128,7 +10128,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 25 + "frequency": "twenty-five (25)" }, { "index": 5, @@ -10141,7 +10141,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 31 + "frequency": "thirty-one" } ], "pitches": [ @@ -10251,7 +10251,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -10277,7 +10277,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 0 + "frequency": "nineteen" }, { "index": 4, @@ -10290,7 +10290,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 25 + "frequency": "twenty-five (25)" }, { "index": 5, @@ -10303,7 +10303,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 31 + "frequency": "thirty-one" } ], "pitches": [ @@ -10817,7 +10817,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 0 + "frequency": "seventeen" }, { "index": 4, @@ -10830,7 +10830,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 23 + "frequency": "twenty-three (23)" }, { "index": 5, @@ -10843,7 +10843,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 29 + "frequency": "twenty-nine" } ], "pitches": [], @@ -10949,7 +10949,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 0 + "frequency": "seventeen" }, { "index": 4, @@ -10962,7 +10962,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 23 + "frequency": "twenty-three (23)" }, { "index": 5, @@ -10975,7 +10975,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 29 + "frequency": "twenty-nine" } ], "pitches": [], @@ -16097,7 +16097,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -16123,7 +16123,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 0 + "frequency": "eighteen" }, { "index": 4, @@ -16136,7 +16136,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 24 + "frequency": "twenty-four (24)" }, { "index": 5, @@ -16259,7 +16259,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -16285,7 +16285,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 0 + "frequency": "eighteen" }, { "index": 4, @@ -16298,7 +16298,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 24 + "frequency": "twenty-four (24)" }, { "index": 5, @@ -16495,7 +16495,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -16521,7 +16521,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 0 + "frequency": "nineteen" }, { "index": 4, @@ -16534,7 +16534,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 25 + "frequency": "twenty-five (25)" }, { "index": 5, @@ -16547,7 +16547,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 31 + "frequency": "thirty-one" } ], "pitches": [ @@ -16657,7 +16657,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -16683,7 +16683,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 0 + "frequency": "nineteen" }, { "index": 4, @@ -16696,7 +16696,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 25 + "frequency": "twenty-five (25)" }, { "index": 5, @@ -16709,7 +16709,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 31 + "frequency": "thirty-one" } ], "pitches": [ @@ -17529,7 +17529,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 0 + "frequency": "sixteen" }, { "index": 4, @@ -17542,7 +17542,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 22 + "frequency": "twenty-two (22)" }, { "index": 5, @@ -17661,7 +17661,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 0 + "frequency": "sixteen" }, { "index": 4, @@ -17674,7 +17674,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 22 + "frequency": "twenty-two (22)" }, { "index": 5, @@ -17835,7 +17835,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 0 + "frequency": "seventeen" }, { "index": 4, @@ -17848,7 +17848,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 23 + "frequency": "twenty-three (23)" }, { "index": 5, @@ -17861,7 +17861,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 29 + "frequency": "twenty-nine" } ], "pitches": [], @@ -17967,7 +17967,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 0 + "frequency": "seventeen" }, { "index": 4, @@ -17980,7 +17980,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 23 + "frequency": "twenty-three (23)" }, { "index": 5, @@ -17993,7 +17993,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 29 + "frequency": "twenty-nine" } ], "pitches": [], @@ -19523,7 +19523,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -19549,7 +19549,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 0 + "frequency": "eighteen" }, { "index": 4, @@ -19562,7 +19562,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 24 + "frequency": "twenty-four (24)" }, { "index": 5, @@ -19685,7 +19685,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -19711,7 +19711,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 0 + "frequency": "eighteen" }, { "index": 4, @@ -19724,7 +19724,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 24 + "frequency": "twenty-four (24)" }, { "index": 5, @@ -19917,7 +19917,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -19943,7 +19943,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 0 + "frequency": "nineteen" }, { "index": 4, @@ -19956,7 +19956,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 25 + "frequency": "twenty-five (25)" }, { "index": 5, @@ -19969,7 +19969,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 31 + "frequency": "thirty-one" } ], "pitches": [ @@ -20079,7 +20079,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -20105,7 +20105,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 0 + "frequency": "nineteen" }, { "index": 4, @@ -20118,7 +20118,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 25 + "frequency": "twenty-five (25)" }, { "index": 5, @@ -20131,7 +20131,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 31 + "frequency": "thirty-one" } ], "pitches": [ @@ -20951,7 +20951,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 0 + "frequency": "sixteen" }, { "index": 4, @@ -20964,7 +20964,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 22 + "frequency": "twenty-two (22)" }, { "index": 5, @@ -21083,7 +21083,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 0 + "frequency": "sixteen" }, { "index": 4, @@ -21096,7 +21096,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 22 + "frequency": "twenty-two (22)" }, { "index": 5, @@ -21257,7 +21257,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 0 + "frequency": "seventeen" }, { "index": 4, @@ -21270,7 +21270,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 23 + "frequency": "twenty-three (23)" }, { "index": 5, @@ -21283,7 +21283,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 29 + "frequency": "twenty-nine" } ], "pitches": [], @@ -21389,7 +21389,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 0 + "frequency": "seventeen" }, { "index": 4, @@ -21402,7 +21402,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 23 + "frequency": "twenty-three (23)" }, { "index": 5, @@ -21415,7 +21415,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 29 + "frequency": "twenty-nine" } ], "pitches": [], @@ -22945,7 +22945,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -22971,7 +22971,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 0 + "frequency": "eighteen" }, { "index": 4, @@ -22984,7 +22984,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 24 + "frequency": "twenty-four (24)" }, { "index": 5, @@ -23107,7 +23107,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -23133,7 +23133,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 0 + "frequency": "eighteen" }, { "index": 4, @@ -23146,7 +23146,7 @@ "expression": "打ち込む", "reading": "うちこむ", "hasReading": true, - "frequency": 24 + "frequency": "twenty-four (24)" }, { "index": 5, @@ -23339,7 +23339,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -23365,7 +23365,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 0 + "frequency": "nineteen" }, { "index": 4, @@ -23378,7 +23378,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 25 + "frequency": "twenty-five (25)" }, { "index": 5, @@ -23391,7 +23391,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 31 + "frequency": "thirty-one" } ], "pitches": [ @@ -23501,7 +23501,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": false, - "frequency": 7 + "frequency": "seven" }, { "index": 2, @@ -23527,7 +23527,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 0 + "frequency": "nineteen" }, { "index": 4, @@ -23540,7 +23540,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 25 + "frequency": "twenty-five (25)" }, { "index": 5, @@ -23553,7 +23553,7 @@ "expression": "打ち込む", "reading": "ぶちこむ", "hasReading": true, - "frequency": 31 + "frequency": "thirty-one" } ], "pitches": [ @@ -24373,7 +24373,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 0 + "frequency": "sixteen" }, { "index": 4, @@ -24386,7 +24386,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 22 + "frequency": "twenty-two (22)" }, { "index": 5, @@ -24505,7 +24505,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 0 + "frequency": "sixteen" }, { "index": 4, @@ -24518,7 +24518,7 @@ "expression": "打つ", "reading": "うつ", "hasReading": true, - "frequency": 22 + "frequency": "twenty-two (22)" }, { "index": 5, @@ -24679,7 +24679,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 0 + "frequency": "seventeen" }, { "index": 4, @@ -24692,7 +24692,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 23 + "frequency": "twenty-three (23)" }, { "index": 5, @@ -24705,7 +24705,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 29 + "frequency": "twenty-nine" } ], "pitches": [], @@ -24811,7 +24811,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 0 + "frequency": "seventeen" }, { "index": 4, @@ -24824,7 +24824,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 23 + "frequency": "twenty-three (23)" }, { "index": 5, @@ -24837,7 +24837,7 @@ "expression": "打つ", "reading": "ぶつ", "hasReading": true, - "frequency": 29 + "frequency": "twenty-nine" } ], "pitches": [], diff --git a/test/data/translator-test-results.json b/test/data/translator-test-results.json index 98db0ef4..0a7155b8 100644 --- a/test/data/translator-test-results.json +++ b/test/data/translator-test-results.json @@ -1101,8 +1101,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "sixteen", + "displayValueParsed": true }, { "index": 4, @@ -1112,8 +1112,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 22, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-two (22)", + "displayValueParsed": true }, { "index": 5, @@ -1266,8 +1266,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "seventeen", + "displayValueParsed": true }, { "index": 4, @@ -1277,8 +1277,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 23, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-three (23)", + "displayValueParsed": true }, { "index": 5, @@ -1288,7 +1288,7 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 29, - "displayValue": null, + "displayValue": "twenty-nine", "displayValueParsed": false } ] @@ -2150,7 +2150,7 @@ "dictionaryPriority": 0, "hasReading": false, "frequency": 7, - "displayValue": null, + "displayValue": "seven", "displayValueParsed": false }, { @@ -2172,8 +2172,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "eighteen", + "displayValueParsed": true }, { "index": 4, @@ -2183,8 +2183,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 24, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-four (24)", + "displayValueParsed": true }, { "index": 5, @@ -2337,7 +2337,7 @@ "dictionaryPriority": 0, "hasReading": false, "frequency": 7, - "displayValue": null, + "displayValue": "seven", "displayValueParsed": false }, { @@ -2359,8 +2359,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "nineteen", + "displayValueParsed": true }, { "index": 4, @@ -2370,8 +2370,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 25, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-five (25)", + "displayValueParsed": true }, { "index": 5, @@ -2381,7 +2381,7 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 31, - "displayValue": null, + "displayValue": "thirty-one", "displayValueParsed": false } ] @@ -2860,8 +2860,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "sixteen", + "displayValueParsed": true }, { "index": 4, @@ -2871,8 +2871,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 22, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-two (22)", + "displayValueParsed": true }, { "index": 5, @@ -3027,8 +3027,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "seventeen", + "displayValueParsed": true }, { "index": 4, @@ -3038,8 +3038,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 23, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-three (23)", + "displayValueParsed": true }, { "index": 5, @@ -3049,7 +3049,7 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 29, - "displayValue": null, + "displayValue": "twenty-nine", "displayValueParsed": false } ] @@ -4166,8 +4166,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "sixteen", + "displayValueParsed": true }, { "index": 4, @@ -4177,8 +4177,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 22, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-two (22)", + "displayValueParsed": true }, { "index": 5, @@ -4502,8 +4502,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "seventeen", + "displayValueParsed": true }, { "index": 4, @@ -4513,8 +4513,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 23, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-three (23)", + "displayValueParsed": true }, { "index": 5, @@ -4524,7 +4524,7 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 29, - "displayValue": null, + "displayValue": "twenty-nine", "displayValueParsed": false } ] @@ -4860,7 +4860,7 @@ "dictionaryPriority": 0, "hasReading": false, "frequency": 7, - "displayValue": null, + "displayValue": "seven", "displayValueParsed": false }, { @@ -4882,8 +4882,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "eighteen", + "displayValueParsed": true }, { "index": 4, @@ -4893,8 +4893,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 24, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-four (24)", + "displayValueParsed": true }, { "index": 5, @@ -5216,8 +5216,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "sixteen", + "displayValueParsed": true }, { "index": 4, @@ -5227,8 +5227,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 22, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-two (22)", + "displayValueParsed": true }, { "index": 5, @@ -5574,7 +5574,7 @@ "dictionaryPriority": 0, "hasReading": false, "frequency": 7, - "displayValue": null, + "displayValue": "seven", "displayValueParsed": false }, { @@ -5596,8 +5596,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "nineteen", + "displayValueParsed": true }, { "index": 4, @@ -5607,8 +5607,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 25, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-five (25)", + "displayValueParsed": true }, { "index": 5, @@ -5618,7 +5618,7 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 31, - "displayValue": null, + "displayValue": "thirty-one", "displayValueParsed": false } ] @@ -5930,8 +5930,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "seventeen", + "displayValueParsed": true }, { "index": 4, @@ -5941,8 +5941,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 23, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-three (23)", + "displayValueParsed": true }, { "index": 5, @@ -5952,7 +5952,7 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 29, - "displayValue": null, + "displayValue": "twenty-nine", "displayValueParsed": false } ] @@ -9645,7 +9645,7 @@ "dictionaryPriority": 0, "hasReading": false, "frequency": 7, - "displayValue": null, + "displayValue": "seven", "displayValueParsed": false }, { @@ -9667,8 +9667,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "eighteen", + "displayValueParsed": true }, { "index": 4, @@ -9678,8 +9678,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 24, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-four (24)", + "displayValueParsed": true }, { "index": 5, @@ -9836,7 +9836,7 @@ "dictionaryPriority": 0, "hasReading": false, "frequency": 7, - "displayValue": null, + "displayValue": "seven", "displayValueParsed": false }, { @@ -9858,8 +9858,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "nineteen", + "displayValueParsed": true }, { "index": 4, @@ -9869,8 +9869,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 25, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-five (25)", + "displayValueParsed": true }, { "index": 5, @@ -9880,7 +9880,7 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 31, - "displayValue": null, + "displayValue": "thirty-one", "displayValueParsed": false } ] @@ -10359,8 +10359,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "sixteen", + "displayValueParsed": true }, { "index": 4, @@ -10370,8 +10370,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 22, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-two (22)", + "displayValueParsed": true }, { "index": 5, @@ -10526,8 +10526,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "seventeen", + "displayValueParsed": true }, { "index": 4, @@ -10537,8 +10537,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 23, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-three (23)", + "displayValueParsed": true }, { "index": 5, @@ -10548,7 +10548,7 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 29, - "displayValue": null, + "displayValue": "twenty-nine", "displayValueParsed": false } ] @@ -11410,7 +11410,7 @@ "dictionaryPriority": 0, "hasReading": false, "frequency": 7, - "displayValue": null, + "displayValue": "seven", "displayValueParsed": false }, { @@ -11432,8 +11432,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "eighteen", + "displayValueParsed": true }, { "index": 4, @@ -11443,8 +11443,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 24, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-four (24)", + "displayValueParsed": true }, { "index": 5, @@ -11597,7 +11597,7 @@ "dictionaryPriority": 0, "hasReading": false, "frequency": 7, - "displayValue": null, + "displayValue": "seven", "displayValueParsed": false }, { @@ -11619,8 +11619,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "nineteen", + "displayValueParsed": true }, { "index": 4, @@ -11630,8 +11630,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 25, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-five (25)", + "displayValueParsed": true }, { "index": 5, @@ -11641,7 +11641,7 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 31, - "displayValue": null, + "displayValue": "thirty-one", "displayValueParsed": false } ] @@ -12120,8 +12120,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "sixteen", + "displayValueParsed": true }, { "index": 4, @@ -12131,8 +12131,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 22, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-two (22)", + "displayValueParsed": true }, { "index": 5, @@ -12287,8 +12287,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "seventeen", + "displayValueParsed": true }, { "index": 4, @@ -12298,8 +12298,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 23, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-three (23)", + "displayValueParsed": true }, { "index": 5, @@ -12309,7 +12309,7 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 29, - "displayValue": null, + "displayValue": "twenty-nine", "displayValueParsed": false } ] @@ -13171,7 +13171,7 @@ "dictionaryPriority": 0, "hasReading": false, "frequency": 7, - "displayValue": null, + "displayValue": "seven", "displayValueParsed": false }, { @@ -13193,8 +13193,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "eighteen", + "displayValueParsed": true }, { "index": 4, @@ -13204,8 +13204,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 24, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-four (24)", + "displayValueParsed": true }, { "index": 5, @@ -13358,7 +13358,7 @@ "dictionaryPriority": 0, "hasReading": false, "frequency": 7, - "displayValue": null, + "displayValue": "seven", "displayValueParsed": false }, { @@ -13380,8 +13380,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "nineteen", + "displayValueParsed": true }, { "index": 4, @@ -13391,8 +13391,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 25, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-five (25)", + "displayValueParsed": true }, { "index": 5, @@ -13402,7 +13402,7 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 31, - "displayValue": null, + "displayValue": "thirty-one", "displayValueParsed": false } ] @@ -13881,8 +13881,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "sixteen", + "displayValueParsed": true }, { "index": 4, @@ -13892,8 +13892,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 22, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-two (22)", + "displayValueParsed": true }, { "index": 5, @@ -14048,8 +14048,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 0, - "displayValue": null, - "displayValueParsed": false + "displayValue": "seventeen", + "displayValueParsed": true }, { "index": 4, @@ -14059,8 +14059,8 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 23, - "displayValue": null, - "displayValueParsed": false + "displayValue": "twenty-three (23)", + "displayValueParsed": true }, { "index": 5, @@ -14070,7 +14070,7 @@ "dictionaryPriority": 0, "hasReading": true, "frequency": 29, - "displayValue": null, + "displayValue": "twenty-nine", "displayValueParsed": false } ] -- cgit v1.2.3 From dcddbee07e20163ae167dd67fe58f0776f9acb64 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Mon, 4 Dec 2023 18:20:05 -0500 Subject: Update how ts comments are handled --- .eslintrc.json | 9 ++++++++- dev/translator-vm.js | 2 +- ext/js/accessibility/google-docs.js | 6 +++--- ext/js/app/popup.js | 2 +- ext/js/background/offscreen-proxy.js | 8 ++++---- ext/js/comm/frame-ancestry-handler.js | 4 ++-- ext/js/dom/document-util.js | 14 ++++++------- ext/js/dom/dom-text-scanner.js | 5 ++--- ext/js/dom/simple-dom-parser.js | 3 +-- ext/js/pages/settings/backup-controller.js | 4 ++-- ext/js/yomitan.js | 4 ++-- test/cache-map.test.js | 2 +- test/data/html/test-document2-script.js | 30 ++++++++++++++-------------- test/object-property-accessor.test.js | 6 +++--- test/profile-conditions-util.test.js | 32 +++++++++++++++--------------- vitest.config.js | 2 +- 16 files changed, 69 insertions(+), 64 deletions(-) (limited to 'test/data') diff --git a/.eslintrc.json b/.eslintrc.json index a46aff4b..83e7ffe6 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -350,7 +350,14 @@ "allowAllPropertiesOnSameLine": true } ], - "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/ban-ts-comment": [ + "error", + { + "ts-expect-error": { + "descriptionFormat": "^ - .+$" + } + } + ], "@typescript-eslint/ban-types": [ "error", { diff --git a/dev/translator-vm.js b/dev/translator-vm.js index 4022d465..7fdda879 100644 --- a/dev/translator-vm.js +++ b/dev/translator-vm.js @@ -42,7 +42,7 @@ export class TranslatorVM { } } }; - // @ts-ignore - Overwriting a global + // @ts-expect-error - Overwriting a global global.chrome = chrome; /** @type {?JapaneseUtil} */ diff --git a/ext/js/accessibility/google-docs.js b/ext/js/accessibility/google-docs.js index da6ab994..27841b6d 100644 --- a/ext/js/accessibility/google-docs.js +++ b/ext/js/accessibility/google-docs.js @@ -18,9 +18,9 @@ (async () => { // Reentrant check - // @ts-ignore : Checking a property to the global object + // @ts-expect-error - Checking a property to the global object if (self.googleDocsAccessibilitySetup) { return; } - // @ts-ignore : Adding a property to the global object + // @ts-expect-error - Adding a property to the global object self.googleDocsAccessibilitySetup = true; /** @@ -57,7 +57,7 @@ // The extension ID below is on an allow-list that is used on the Google Docs webpage. /* eslint-disable */ - // @ts-ignore : Adding a property to the global object + // @ts-expect-error : Adding a property to the global object const inject = () => { window._docs_annotate_canvas_by_ext = 'ogmnaimimemjmbakcfefmnahgdfhfami'; }; /* eslint-enable */ diff --git a/ext/js/app/popup.js b/ext/js/app/popup.js index 4f201fc3..7419785b 100644 --- a/ext/js/app/popup.js +++ b/ext/js/app/popup.js @@ -745,7 +745,7 @@ export class Popup extends EventDispatcher { if ( fullscreenElement === null || fullscreenElement.shadowRoot || - // @ts-ignore - openOrClosedShadowRoot is available to Firefox 63+ for WebExtensions + // @ts-expect-error - openOrClosedShadowRoot is available to Firefox 63+ for WebExtensions fullscreenElement.openOrClosedShadowRoot ) { return defaultParent; diff --git a/ext/js/background/offscreen-proxy.js b/ext/js/background/offscreen-proxy.js index 7b504855..63f619fa 100644 --- a/ext/js/background/offscreen-proxy.js +++ b/ext/js/background/offscreen-proxy.js @@ -54,16 +54,16 @@ export class OffscreenProxy { */ async _hasOffscreenDocument() { const offscreenUrl = chrome.runtime.getURL('offscreen.html'); - // @ts-ignore - API not defined yet + // @ts-expect-error - API not defined yet if (!chrome.runtime.getContexts) { // chrome version below 116 // Clients: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/clients - // @ts-ignore - Types not set up for service workers yet + // @ts-expect-error - Types not set up for service workers yet const matchedClients = await clients.matchAll(); - // @ts-ignore - Types not set up for service workers yet + // @ts-expect-error - Types not set up for service workers yet return await matchedClients.some((client) => client.url === offscreenUrl); } - // @ts-ignore - API not defined yet + // @ts-expect-error - API not defined yet const contexts = await chrome.runtime.getContexts({ contextTypes: ['OFFSCREEN_DOCUMENT'], documentUrls: [offscreenUrl] diff --git a/ext/js/comm/frame-ancestry-handler.js b/ext/js/comm/frame-ancestry-handler.js index 687ec368..e4d08f28 100644 --- a/ext/js/comm/frame-ancestry-handler.js +++ b/ext/js/comm/frame-ancestry-handler.js @@ -295,7 +295,7 @@ export class FrameAncestryHandler { while (walker.nextNode()) { const element = /** @type {Element} */ (walker.currentNode); - // @ts-ignore - this is more simple to elide any type checks or casting + // @ts-expect-error - this is more simple to elide any type checks or casting if (element.contentWindow === contentWindow) { return element; } @@ -303,7 +303,7 @@ export class FrameAncestryHandler { /** @type {?ShadowRoot|undefined} */ const shadowRoot = ( element.shadowRoot || - // @ts-ignore - openOrClosedShadowRoot is available to Firefox 63+ for WebExtensions + // @ts-expect-error - openOrClosedShadowRoot is available to Firefox 63+ for WebExtensions element.openOrClosedShadowRoot ); if (shadowRoot) { diff --git a/ext/js/dom/document-util.js b/ext/js/dom/document-util.js index 549a8195..b2aa8f81 100644 --- a/ext/js/dom/document-util.js +++ b/ext/js/dom/document-util.js @@ -210,7 +210,7 @@ export class DocumentUtil { */ static computeZoomScale(node) { if (this._cssZoomSupported === null) { - // @ts-ignore - zoom is a non-standard property that exists in Chromium-based browsers + // @ts-expect-error - zoom is a non-standard property that exists in Chromium-based browsers this._cssZoomSupported = (typeof document.createElement('div').style.zoom === 'string'); } if (!this._cssZoomSupported) { return 1; } @@ -387,11 +387,11 @@ export class DocumentUtil { static getFullscreenElement() { return ( document.fullscreenElement || - // @ts-ignore - vendor prefix + // @ts-expect-error - vendor prefix document.msFullscreenElement || - // @ts-ignore - vendor prefix + // @ts-expect-error - vendor prefix document.mozFullScreenElement || - // @ts-ignore - vendor prefix + // @ts-expect-error - vendor prefix document.webkitFullscreenElement || null ); @@ -808,7 +808,7 @@ export class DocumentUtil { return document.caretRangeFromPoint(x, y); } - // @ts-ignore - caretPositionFromPoint is non-standard + // @ts-expect-error - caretPositionFromPoint is non-standard if (typeof document.caretPositionFromPoint === 'function') { // Firefox return this._caretPositionFromPoint(x, y); @@ -824,7 +824,7 @@ export class DocumentUtil { * @returns {?Range} */ static _caretPositionFromPoint(x, y) { - // @ts-ignore - caretPositionFromPoint is non-standard + // @ts-expect-error - caretPositionFromPoint is non-standard const position = /** @type {(x: number, y: number) => ?{offsetNode: Node, offset: number}} */ (document.caretPositionFromPoint)(x, y); if (position === null) { return null; @@ -876,7 +876,7 @@ export class DocumentUtil { nextElement.style.setProperty('user-select', 'text', 'important'); } - // @ts-ignore - caretPositionFromPoint is non-standard + // @ts-expect-error - caretPositionFromPoint is non-standard const position = /** @type {(x: number, y: number) => ?{offsetNode: Node, offset: number}} */ (document.caretPositionFromPoint)(x, y); if (position === null) { return null; diff --git a/ext/js/dom/dom-text-scanner.js b/ext/js/dom/dom-text-scanner.js index 3a785680..42e0acc9 100644 --- a/ext/js/dom/dom-text-scanner.js +++ b/ext/js/dom/dom-text-scanner.js @@ -520,11 +520,10 @@ export class DOMTextScanner { static isStyleSelectable(style) { return !( style.userSelect === 'none' || - // @ts-ignore - vendor prefix style.webkitUserSelect === 'none' || - // @ts-ignore - vendor prefix + // @ts-expect-error - vendor prefix style.MozUserSelect === 'none' || - // @ts-ignore - vendor prefix + // @ts-expect-error - vendor prefix style.msUserSelect === 'none' ); } diff --git a/ext/js/dom/simple-dom-parser.js b/ext/js/dom/simple-dom-parser.js index a1f63890..bca1cd88 100644 --- a/ext/js/dom/simple-dom-parser.js +++ b/ext/js/dom/simple-dom-parser.js @@ -27,7 +27,7 @@ export class SimpleDOMParser { */ constructor(content) { /** @type {import('parse5')} */ - // @ts-ignore - parse5 global is not defined in typescript declaration + // @ts-expect-error - parse5 global is not defined in typescript declaration this._parse5Lib = /** @type {import('parse5')} */ (parse5); /** @type {import('parse5').TreeAdapter} */ this._treeAdapter = this._parse5Lib.defaultTreeAdapter; @@ -131,7 +131,6 @@ export class SimpleDOMParser { * @returns {boolean} */ static isSupported() { - // @ts-ignore - parse5 global is not defined in typescript declaration return typeof parse5 !== 'undefined'; } diff --git a/ext/js/pages/settings/backup-controller.js b/ext/js/pages/settings/backup-controller.js index 52c5f418..bf44bb90 100644 --- a/ext/js/pages/settings/backup-controller.js +++ b/ext/js/pages/settings/backup-controller.js @@ -165,9 +165,9 @@ export class BackupController { _saveBlob(blob, fileName) { if ( typeof navigator === 'object' && navigator !== null && - // @ts-ignore - call for legacy Edge + // @ts-expect-error - call for legacy Edge typeof navigator.msSaveBlob === 'function' && - // @ts-ignore - call for legacy Edge + // @ts-expect-error - call for legacy Edge navigator.msSaveBlob(blob) ) { return; diff --git a/ext/js/yomitan.js b/ext/js/yomitan.js index 3c0f7cb9..7cf67aec 100644 --- a/ext/js/yomitan.js +++ b/ext/js/yomitan.js @@ -37,7 +37,7 @@ if ((() => { } return (hasBrowser && !hasChrome); })()) { - // @ts-ignore - objects should have roughly the same interface + // @ts-expect-error - objects should have roughly the same interface chrome = browser; } @@ -182,7 +182,7 @@ export class Yomitan extends EventDispatcher { */ sendMessage(...args) { try { - // @ts-ignore - issue with type conversion, somewhat difficult to resolve in pure JS + // @ts-expect-error - issue with type conversion, somewhat difficult to resolve in pure JS chrome.runtime.sendMessage(...args); } catch (e) { this.triggerExtensionUnloaded(); diff --git a/test/cache-map.test.js b/test/cache-map.test.js index 3e7def1f..df891188 100644 --- a/test/cache-map.test.js +++ b/test/cache-map.test.js @@ -30,7 +30,7 @@ function testConstructor() { [true, () => new CacheMap(1.5)], [true, () => new CacheMap(Number.NaN)], [true, () => new CacheMap(Number.POSITIVE_INFINITY)], - // @ts-ignore - Ignore because it should throw an error + // @ts-expect-error - Ignore because it should throw an error [true, () => new CacheMap('a')] ]; diff --git a/test/data/html/test-document2-script.js b/test/data/html/test-document2-script.js index 5a6ad4d1..f6082802 100644 --- a/test/data/html/test-document2-script.js +++ b/test/data/html/test-document2-script.js @@ -22,17 +22,17 @@ function requestFullscreen(element) { if (element.requestFullscreen) { element.requestFullscreen(); - // @ts-ignore - Browser compatibility + // @ts-expect-error - Browser compatibility } else if (element.mozRequestFullScreen) { - // @ts-ignore - Browser compatibility + // @ts-expect-error - Browser compatibility element.mozRequestFullScreen(); - // @ts-ignore - Browser compatibility + // @ts-expect-error - Browser compatibility } else if (element.webkitRequestFullscreen) { - // @ts-ignore - Browser compatibility + // @ts-expect-error - Browser compatibility element.webkitRequestFullscreen(); - // @ts-ignore - Browser compatibility + // @ts-expect-error - Browser compatibility } else if (element.msRequestFullscreen) { - // @ts-ignore - Browser compatibility + // @ts-expect-error - Browser compatibility element.msRequestFullscreen(); } } @@ -41,17 +41,17 @@ function requestFullscreen(element) { function exitFullscreen() { if (document.exitFullscreen) { document.exitFullscreen(); - // @ts-ignore - Browser compatibility + // @ts-expect-error - Browser compatibility } else if (document.mozCancelFullScreen) { - // @ts-ignore - Browser compatibility + // @ts-expect-error - Browser compatibility document.mozCancelFullScreen(); - // @ts-ignore - Browser compatibility + // @ts-expect-error - Browser compatibility } else if (document.webkitExitFullscreen) { - // @ts-ignore - Browser compatibility + // @ts-expect-error - Browser compatibility document.webkitExitFullscreen(); - // @ts-ignore - Browser compatibility + // @ts-expect-error - Browser compatibility } else if (document.msExitFullscreen) { - // @ts-ignore - Browser compatibility + // @ts-expect-error - Browser compatibility document.msExitFullscreen(); } } @@ -62,11 +62,11 @@ function exitFullscreen() { function getFullscreenElement() { return ( document.fullscreenElement || - // @ts-ignore - Browser compatibility + // @ts-expect-error - Browser compatibility document.msFullscreenElement || - // @ts-ignore - Browser compatibility + // @ts-expect-error - Browser compatibility document.mozFullScreenElement || - // @ts-ignore - Browser compatibility + // @ts-expect-error - Browser compatibility document.webkitFullscreenElement || null ); diff --git a/test/object-property-accessor.test.js b/test/object-property-accessor.test.js index 4f1fa87b..4d50b1e9 100644 --- a/test/object-property-accessor.test.js +++ b/test/object-property-accessor.test.js @@ -334,7 +334,7 @@ function testGetPathString2() { ]; for (const [pathArray, message] of data) { - // @ts-ignore - Throwing is expected + // @ts-expect-error - Throwing is expected expect(() => ObjectPropertyAccessor.getPathString(pathArray)).toThrow(message); } }); @@ -424,7 +424,7 @@ function testHasProperty() { ]; for (const [object, property, expected] of data) { - // @ts-ignore - Ignore potentially property types + // @ts-expect-error - Ignore potentially property types expect(ObjectPropertyAccessor.hasProperty(object, property)).toStrictEqual(expected); } }); @@ -449,7 +449,7 @@ function testIsValidPropertyType() { ]; for (const [object, property, expected] of data) { - // @ts-ignore - Ignore potentially property types + // @ts-expect-error - Ignore potentially property types expect(ObjectPropertyAccessor.isValidPropertyType(object, property)).toStrictEqual(expected); } }); diff --git a/test/profile-conditions-util.test.js b/test/profile-conditions-util.test.js index 30052b34..62b21555 100644 --- a/test/profile-conditions-util.test.js +++ b/test/profile-conditions-util.test.js @@ -637,9 +637,9 @@ function testSchemas() { {expected: true, context: {depth: 0, url: ''}}, {expected: true, context: {depth: 0, url: '', flags: []}}, {expected: false, context: {depth: 0, url: '', flags: ['clipboard']}}, - // @ts-ignore - Ignore type for string flag for testing purposes + // @ts-expect-error - Ignore type for string flag for testing purposes {expected: false, context: {depth: 0, url: '', flags: ['clipboard', 'test2']}}, - // @ts-ignore - Ignore type for string flag for testing purposes + // @ts-expect-error - Ignore type for string flag for testing purposes {expected: false, context: {depth: 0, url: '', flags: ['clipboard', 'test2', 'test3']}} ] }, @@ -673,9 +673,9 @@ function testSchemas() { {expected: false, context: {depth: 0, url: ''}}, {expected: false, context: {depth: 0, url: '', flags: []}}, {expected: false, context: {depth: 0, url: '', flags: ['clipboard']}}, - // @ts-ignore - Ignore type for string flag for testing purposes + // @ts-expect-error - Ignore type for string flag for testing purposes {expected: true, context: {depth: 0, url: '', flags: ['clipboard', 'test2']}}, - // @ts-ignore - Ignore type for string flag for testing purposes + // @ts-expect-error - Ignore type for string flag for testing purposes {expected: false, context: {depth: 0, url: '', flags: ['clipboard', 'test2', 'test3']}} ] }, @@ -711,9 +711,9 @@ function testSchemas() { {expected: false, context: {depth: 0, url: ''}}, {expected: false, context: {depth: 0, url: '', flags: []}}, {expected: true, context: {depth: 0, url: '', flags: ['clipboard']}}, - // @ts-ignore - Ignore type for string flag for testing purposes + // @ts-expect-error - Ignore type for string flag for testing purposes {expected: true, context: {depth: 0, url: '', flags: ['clipboard', 'test2']}}, - // @ts-ignore - Ignore type for string flag for testing purposes + // @ts-expect-error - Ignore type for string flag for testing purposes {expected: true, context: {depth: 0, url: '', flags: ['clipboard', 'test2', 'test3']}} ] }, @@ -753,9 +753,9 @@ function testSchemas() { {expected: true, context: {depth: 0, url: ''}}, {expected: true, context: {depth: 0, url: '', flags: []}}, {expected: true, context: {depth: 0, url: '', flags: ['clipboard']}}, - // @ts-ignore - Ignore type for string flag for testing purposes + // @ts-expect-error - Ignore type for string flag for testing purposes {expected: false, context: {depth: 0, url: '', flags: ['clipboard', 'test2']}}, - // @ts-ignore - Ignore type for string flag for testing purposes + // @ts-expect-error - Ignore type for string flag for testing purposes {expected: true, context: {depth: 0, url: '', flags: ['clipboard', 'test2', 'test3']}} ] }, @@ -784,9 +784,9 @@ function testSchemas() { {expected: true, context: {depth: 0, url: ''}}, {expected: true, context: {depth: 0, url: '', flags: []}}, {expected: true, context: {depth: 0, url: '', flags: ['clipboard']}}, - // @ts-ignore - Ignore type for string flag for testing purposes + // @ts-expect-error - Ignore type for string flag for testing purposes {expected: true, context: {depth: 0, url: '', flags: ['clipboard', 'test2']}}, - // @ts-ignore - Ignore type for string flag for testing purposes + // @ts-expect-error - Ignore type for string flag for testing purposes {expected: true, context: {depth: 0, url: '', flags: ['clipboard', 'test2', 'test3']}} ] }, @@ -819,9 +819,9 @@ function testSchemas() { {expected: false, context: {depth: 0, url: ''}}, {expected: false, context: {depth: 0, url: '', flags: []}}, {expected: false, context: {depth: 0, url: '', flags: ['clipboard']}}, - // @ts-ignore - Ignore type for string flag for testing purposes + // @ts-expect-error - Ignore type for string flag for testing purposes {expected: true, context: {depth: 0, url: '', flags: ['clipboard', 'test2']}}, - // @ts-ignore - Ignore type for string flag for testing purposes + // @ts-expect-error - Ignore type for string flag for testing purposes {expected: true, context: {depth: 0, url: '', flags: ['clipboard', 'test2', 'test3']}} ] }, @@ -849,9 +849,9 @@ function testSchemas() { {expected: true, context: {depth: 0, url: ''}}, {expected: true, context: {depth: 0, url: '', flags: []}}, {expected: true, context: {depth: 0, url: '', flags: ['clipboard']}}, - // @ts-ignore - Ignore type for string flag for testing purposes + // @ts-expect-error - Ignore type for string flag for testing purposes {expected: true, context: {depth: 0, url: '', flags: ['clipboard', 'test2']}}, - // @ts-ignore - Ignore type for string flag for testing purposes + // @ts-expect-error - Ignore type for string flag for testing purposes {expected: true, context: {depth: 0, url: '', flags: ['clipboard', 'test2', 'test3']}} ] }, @@ -885,9 +885,9 @@ function testSchemas() { {expected: true, context: {depth: 0, url: ''}}, {expected: true, context: {depth: 0, url: '', flags: []}}, {expected: false, context: {depth: 0, url: '', flags: ['clipboard']}}, - // @ts-ignore - Ignore type for string flag for testing purposes + // @ts-expect-error - Ignore type for string flag for testing purposes {expected: false, context: {depth: 0, url: '', flags: ['clipboard', 'test2']}}, - // @ts-ignore - Ignore type for string flag for testing purposes + // @ts-expect-error - Ignore type for string flag for testing purposes {expected: false, context: {depth: 0, url: '', flags: ['clipboard', 'test2', 'test3']}} ] }, diff --git a/vitest.config.js b/vitest.config.js index 3b6cdde0..025eec17 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -24,7 +24,7 @@ export default defineConfig({ 'test/playwright/**' ], environment: 'jsdom', - // @ts-ignore - Appears to not be defined in the type definitions (https://vitest.dev/advanced/pool) + // @ts-expect-error - Appears to not be defined in the type definitions (https://vitest.dev/advanced/pool) poolOptions: { threads: { useAtomics: true -- cgit v1.2.3