Skip to content

Commit 71b2895

Browse files
committedFeb 1, 2024
Fix error message if name is invalid
1 parent 7d97da9 commit 71b2895

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎src/remark-mdx-frontmatter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const remarkMdxFrontmatter: Plugin<[RemarkMdxFrontmatterOptions?], Root> = ({
3737
parsers
3838
} = {}) => {
3939
if (!isIdentifierName(name)) {
40-
throw new Error(`Name this should be a valid identifier, got: ${JSON.stringify(name)}`)
40+
throw new Error(`Name should be a valid identifier, got: ${JSON.stringify(name)}`)
4141
}
4242

4343
const allParsers: FrontmatterParsers = {

‎src/test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ test('invalid name', () => {
6161
remarkPlugins: [remarkFrontmatter, [remarkMdxFrontmatter, { name: 'Not valid' }]],
6262
jsx: true
6363
}),
64-
'If name is specified, this should be a valid identifier name, got: "Not valid"'
64+
/Name should be a valid identifier, got: "Not valid"/
6565
)
6666
})

0 commit comments

Comments
 (0)
Please sign in to comment.