Urara-Blog/node_modules/.pnpm-store/v3/files/4b/335befbd1ef16e31b5beb02dd167c70eade81f2e1ed610812d04168071f9f9f162408ca0da62236ad4be605a708c64bf3e70f3852b88b0e68b3e6e4853404e
2022-08-14 01:14:53 +08:00

22 lines
507 B
Text

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