Address new code analysis issues from previous commit.
Some checks failed
Checkers / linkcheck (push) Has been cancelled
Checkers / spellcheck (push) Has been cancelled
CI / build (20, macos-latest) (push) Has been cancelled
CI / build (20, ubuntu-latest) (push) Has been cancelled
CI / build (20, windows-latest) (push) Has been cancelled
CI / build (22, macos-latest) (push) Has been cancelled
CI / build (22, ubuntu-latest) (push) Has been cancelled
CI / build (22, windows-latest) (push) Has been cancelled
CI / build (24, macos-latest) (push) Has been cancelled
CI / build (24, ubuntu-latest) (push) Has been cancelled
CI / build (24, windows-latest) (push) Has been cancelled
CI / pnpm (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
TestRepos / build (latest, ubuntu-latest) (push) Has been cancelled
UpdateTestRepos / update (push) Has been cancelled

This commit is contained in:
David Anson 2025-09-27 06:21:34 +00:00
parent 3a5a59a422
commit d9eedde37d
6 changed files with 20 additions and 7 deletions

View file

@ -36,11 +36,12 @@ export function micromarkTokens() {
* Gets a cached object value - computes it and caches it.
*
* @param {string} name Cache object name.
* @param {Function} getValue Getter for object value.
* @param {() => Object} getValue Getter for object value.
* @returns {Object} Object value.
*/
function getCached(name, getValue) {
if (map.has(name)) {
// @ts-ignore
return map.get(name);
}
const value = getValue();
@ -56,6 +57,7 @@ function getCached(name, getValue) {
* @returns {MicromarkToken[]} Filtered tokens.
*/
export function filterByTypesCached(types, htmlFlow) {
// @ts-ignore
return getCached(
// eslint-disable-next-line prefer-rest-params
JSON.stringify(arguments),