Urara-Blog/node_modules/.pnpm-store/v3/files/ce/292cd0da1be68dace4f0a74ffcf0bd63a451293f87d37c6854c85879676ba59ce9fd7b928d2d2fba5667fa896501d24e859defd13cbdb062641d135373726f
2022-08-14 01:14:53 +08:00

28 lines
685 B
Text

/**
* @typedef {import('../types.js').Context} Context
* @typedef {import('../types.js').Options} Options
*/
/**
* @param {Context} context
* @returns {Exclude<Options['listItemIndent'], undefined>}
*/
export function checkListItemIndent(context) {
const style = context.options.listItemIndent || 'tab'
// To do: remove in a major.
// @ts-expect-error: deprecated.
if (style === 1 || style === '1') {
return 'one'
}
if (style !== 'tab' && style !== 'one' && style !== 'mixed') {
throw new Error(
'Cannot serialize items with `' +
style +
'` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`'
)
}
return style
}