astro-ghostcms/.pnpm-store/v3/files/8f/56a2f6447d6f9ebbb250bab9cc6...

23 lines
485 B
Plaintext
Raw Normal View History

2024-02-14 14:10:47 +00:00
/**
* @typedef {import('../types.js').Options} Options
* @typedef {import('../types.js').State} State
*/
/**
* @param {State} state
* @returns {Exclude<Options['fence'], null | undefined>}
*/
export function checkFence(state) {
const marker = state.options.fence || '`'
if (marker !== '`' && marker !== '~') {
throw new Error(
'Cannot serialize code with `' +
marker +
'` for `options.fence`, expected `` ` `` or `~`'
)
}
return marker
}