Refactor routing in App component to enhance navigation and improve error handling by integrating dynamic routes and updating the NotFound route.
This commit is contained in:
38
node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js
generated
vendored
Normal file
38
node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @import {Options, State} from 'mdast-util-to-markdown'
|
||||
*/
|
||||
|
||||
import {checkBullet} from './check-bullet.js'
|
||||
|
||||
/**
|
||||
* @param {State} state
|
||||
* @returns {Exclude<Options['bullet'], null | undefined>}
|
||||
*/
|
||||
export function checkBulletOther(state) {
|
||||
const bullet = checkBullet(state)
|
||||
const bulletOther = state.options.bulletOther
|
||||
|
||||
if (!bulletOther) {
|
||||
return bullet === '*' ? '-' : '*'
|
||||
}
|
||||
|
||||
if (bulletOther !== '*' && bulletOther !== '+' && bulletOther !== '-') {
|
||||
throw new Error(
|
||||
'Cannot serialize items with `' +
|
||||
bulletOther +
|
||||
'` for `options.bulletOther`, expected `*`, `+`, or `-`'
|
||||
)
|
||||
}
|
||||
|
||||
if (bulletOther === bullet) {
|
||||
throw new Error(
|
||||
'Expected `bullet` (`' +
|
||||
bullet +
|
||||
'`) and `bulletOther` (`' +
|
||||
bulletOther +
|
||||
'`) to be different'
|
||||
)
|
||||
}
|
||||
|
||||
return bulletOther
|
||||
}
|
Reference in New Issue
Block a user