diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2024-02-24 23:47:57 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-25 04:47:57 +0000 |
commit | 73169f06dff767020718a5715eba97d3575ba7e1 (patch) | |
tree | 99d458f9d2ca74e67dbb4bccd148ef549f7ce2cf /test/dom-text-scanner.test.js | |
parent | a21948daf6210f67955ae4f98a81e21b8cf9f1f2 (diff) |
Turn on @typescript-eslint/no-unsafe-argument (#728)24.2.26.0
Diffstat (limited to 'test/dom-text-scanner.test.js')
-rw-r--r-- | test/dom-text-scanner.test.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/dom-text-scanner.test.js b/test/dom-text-scanner.test.js index 1ec7cab7..b366cadd 100644 --- a/test/dom-text-scanner.test.js +++ b/test/dom-text-scanner.test.js @@ -88,10 +88,16 @@ function createAbsoluteGetComputedStyle(window) { get: (target, property) => { let result = /** @type {import('core').SafeAny} */ (target)[property]; if (typeof result === 'string') { - result = result.replace(/([-+]?\d(?:\.\d)?(?:[eE][-+]?\d+)?)em/g, (g0, g1) => { + /** + * @param {string} g0 + * @param {string} g1 + * @returns {string} + */ + const replacer = (g0, g1) => { const fontSize = getComputedFontSizeInPixels(window, getComputedStyleOld, element); return `${Number.parseFloat(g1) * fontSize}px`; - }); + }; + result = result.replace(/([-+]?\d(?:\.\d)?(?:[eE][-+]?\d+)?)em/g, replacer); } return result; } |