.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / remark-stringify / lib / visitors / thematic-break.js
1 'use strict';
2
3 var repeat = require('repeat-string');
4
5 module.exports = thematic;
6
7 /* Stringify a `thematic-break`.
8  * The character used is configurable through `rule`: (`'_'`)
9  *
10  *     ___
11  *
12  * The number of repititions is defined through
13  * `ruleRepetition`: (`6`)
14  *
15  *     ******
16  *
17  * Whether spaces delimit each character, is configured
18  * through `ruleSpaces`: (`true`)
19  *
20  *     * * *
21  */
22 function thematic() {
23   var options = this.options;
24   var rule = repeat(options.rule, options.ruleRepetition);
25   return options.ruleSpaces ? rule.split('').join(' ') : rule;
26 }