.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / remark-parse / lib / util / interrupt.js
1 'use strict';
2
3 module.exports = interrupt;
4
5 function interrupt(interruptors, tokenizers, ctx, params) {
6   var bools = ['pedantic', 'commonmark'];
7   var count = bools.length;
8   var length = interruptors.length;
9   var index = -1;
10   var interruptor;
11   var config;
12   var fn;
13   var offset;
14   var bool;
15   var ignore;
16
17   while (++index < length) {
18     interruptor = interruptors[index];
19     config = interruptor[1] || {};
20     fn = interruptor[0];
21     offset = -1;
22     ignore = false;
23
24     while (++offset < count) {
25       bool = bools[offset];
26
27       if (config[bool] !== undefined && config[bool] !== ctx.options[bool]) {
28         ignore = true;
29         break;
30       }
31     }
32
33     if (ignore) {
34       continue;
35     }
36
37     if (tokenizers[fn].apply(ctx, params)) {
38       return true;
39     }
40   }
41
42   return false;
43 }