Skip to content

Commit e5bafd6

Browse files
committed
fix(mdream): TagIdMap type safety
1 parent 063921c commit e5bafd6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/mdream/src/const.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export const NodeEventEnter = 0
130130
export const NodeEventExit = 1
131131

132132
// Map string tag names to numeric constants
133-
export const TagIdMap: Record<string, number> = {
133+
export const TagIdMap = {
134134
html: TAG_HTML,
135135
head: TAG_HEAD,
136136
details: TAG_DETAILS,
@@ -239,7 +239,7 @@ export const TagIdMap: Record<string, number> = {
239239
header: TAG_HEADER,
240240
figcaption: TAG_FIGCAPTION,
241241
caption: TAG_CAPTION,
242-
}
242+
} as const
243243

244244
// Pre-defined strings to avoid repeated allocations
245245
export const MARKDOWN_STRONG = '**'

0 commit comments

Comments
 (0)