Refactor helpers slightly for consistency.

This commit is contained in:
David Anson 2024-09-28 15:55:26 -07:00
parent 124b7e2276
commit 97effd921e
6 changed files with 36 additions and 50 deletions

View file

@ -3,7 +3,7 @@
"use strict";
const { addErrorDetailIf } = require("../helpers");
const { getTokenParentOfType } = require("../helpers/micromark.cjs");
const { getParentOfType } = require("../helpers/micromark.cjs");
const { filterByTypesCached } = require("./cache");
// eslint-disable-next-line jsdoc/valid-types
@ -39,7 +39,7 @@ module.exports = {
let current = token;
while (
// @ts-ignore
(current = getTokenParentOfType(current, unorderedParentTypes))
(current = getParentOfType(current, unorderedParentTypes))
) {
if (current.type === "listUnordered") {
nesting++;