Urara-Blog/node_modules/.pnpm-store/v3/files/7a/7517ad625f50d98ce357f928cc9f1860e69a994b65952e4c006d063251ad94211a5a80aba2d23538119e1f508ea1549031d77933adf91cccfe3cb21dfb2d78
2022-08-14 01:14:53 +08:00

22 lines
503 B
Text

/**
* @typedef {import('../types.js').Context} Context
* @typedef {import('../types.js').Options} Options
*/
/**
* @param {Context} context
* @returns {Exclude<Options['emphasis'], undefined>}
*/
export function checkEmphasis(context) {
const marker = context.options.emphasis || '*'
if (marker !== '*' && marker !== '_') {
throw new Error(
'Cannot serialize emphasis with `' +
marker +
'` for `options.emphasis`, expected `*`, or `_`'
)
}
return marker
}