mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-06 16:09:13 +08:00
22 lines
493 B
Text
22 lines
493 B
Text
/**
|
|
* @typedef {import('../types.js').Context} Context
|
|
* @typedef {import('../types.js').Options} Options
|
|
*/
|
|
|
|
/**
|
|
* @param {Context} context
|
|
* @returns {Exclude<Options['strong'], undefined>}
|
|
*/
|
|
export function checkStrong(context) {
|
|
const marker = context.options.strong || '*'
|
|
|
|
if (marker !== '*' && marker !== '_') {
|
|
throw new Error(
|
|
'Cannot serialize strong with `' +
|
|
marker +
|
|
'` for `options.strong`, expected `*`, or `_`'
|
|
)
|
|
}
|
|
|
|
return marker
|
|
}
|