Improve type safety by strongly-typing the micromark token type property everywhere.

This commit is contained in:
David Anson 2024-02-29 23:05:27 -08:00
parent 828ae3541a
commit 28e1b23955
7 changed files with 106 additions and 50 deletions

View file

@ -277,7 +277,7 @@ module.exports.fencedCodeBlockStyleFor =
* Return the string representation of a emphasis or strong markup character.
*
* @param {string} markup Emphasis or strong string.
* @returns {string} String representation.
* @returns {"asterisk" | "underscore"} String representation.
*/
module.exports.emphasisOrStrongStyleFor =
function emphasisOrStrongStyleFor(markup) {
@ -316,7 +316,7 @@ module.exports.headingStyleFor = function headingStyleFor(token) {
* Return the string representation of an unordered list marker.
*
* @param {Object} token MarkdownItToken instance.
* @returns {string} String representation.
* @returns {"asterisk" | "dash" | "plus"} String representation.
*/
module.exports.unorderedListStyleFor = function unorderedListStyleFor(token) {
switch (token.markup) {