the editable site (validation-lab)
This commit is contained in:
commit
3ac81d5a52
13454 files changed
+2227005
No files matched your search
+25
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @import {Options, State} from 'mdast-util-to-markdown'
|
||||
*/
|
||||
|
||||
/**
|
||||
* Checks the preferred rule repetition option.
|
||||
*
|
||||
* @param {State} state
|
||||
* Info passed around.
|
||||
* @returns {Exclude<Options['ruleRepetition'], null | undefined>}
|
||||
* Preferred rule repetition.
|
||||
*/
|
||||
export function checkRuleRepetition(state) {
|
||||
const repetition = state.options.ruleRepetition || 3
|
||||
|
||||
if (repetition < 3) {
|
||||
throw new Error(
|
||||
'Cannot serialize rules with repetition `' +
|
||||
repetition +
|
||||
'` for `options.ruleRepetition`, expected `3` or more'
|
||||
)
|
||||
}
|
||||
|
||||
return repetition
|
||||
}
|
||||
Reference in new issue
Block a user