@salesforcedevs/sfdocs-liquid-lint-filtered-blocks 1.0.0-alpha-blocks1 → 1.0.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -61
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/src/__tests__/index.test.ts +24 -77
- package/src/index.ts +58 -81
- package/tsconfig.tsbuildinfo +0 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AA+HA,kBAA2C"}
|
package/dist/index.js
CHANGED
|
@@ -3,23 +3,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
const unified_lint_rule_1 = __importDefault(require("unified-lint-rule"));
|
|
6
|
+
const unist_util_visit_1 = __importDefault(require("unist-util-visit"));
|
|
6
7
|
const sfdocs_liquid_lint_utils_1 = require("@salesforcedevs/sfdocs-liquid-lint-utils");
|
|
7
8
|
const SOURCE = 'sfdocs-liquid-lint:liquid-filtered-blocks';
|
|
8
9
|
function findBlockRanges(content, tagName) {
|
|
9
10
|
const ranges = [];
|
|
10
11
|
const tagRe = new RegExp(`{%-?\\s*(${tagName}|end${tagName})\\s*-?%}`, 'g');
|
|
11
|
-
const
|
|
12
|
+
const unmatchedOpeners = [];
|
|
12
13
|
let match;
|
|
13
14
|
while ((match = tagRe.exec(content)) !== null) {
|
|
14
15
|
if (match[1] === tagName) {
|
|
15
|
-
|
|
16
|
+
unmatchedOpeners.push(match.index);
|
|
16
17
|
}
|
|
17
|
-
else if (
|
|
18
|
-
const open = openStack.pop();
|
|
18
|
+
else if (unmatchedOpeners.length > 0) {
|
|
19
19
|
ranges.push({
|
|
20
|
-
openStart:
|
|
21
|
-
openEnd: open.end,
|
|
22
|
-
closeStart: match.index,
|
|
20
|
+
openStart: unmatchedOpeners.pop(),
|
|
23
21
|
closeEnd: match.index + match[0].length,
|
|
24
22
|
});
|
|
25
23
|
}
|
|
@@ -29,17 +27,8 @@ function findBlockRanges(content, tagName) {
|
|
|
29
27
|
function isInsideRange(offset, ranges) {
|
|
30
28
|
return ranges.some(r => offset >= r.openStart && offset < r.closeEnd);
|
|
31
29
|
}
|
|
32
|
-
function isNestedBlock(
|
|
33
|
-
|
|
34
|
-
for (let i = 0; i < ranges.length; i++) {
|
|
35
|
-
if (i === blockIndex)
|
|
36
|
-
continue;
|
|
37
|
-
const outer = ranges[i];
|
|
38
|
-
if (block.openStart > outer.openStart && block.closeEnd < outer.closeEnd) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return false;
|
|
30
|
+
function isNestedBlock(block, ranges) {
|
|
31
|
+
return ranges.some(r => r !== block && block.openStart > r.openStart && block.closeEnd < r.closeEnd);
|
|
43
32
|
}
|
|
44
33
|
function isEntireFileWrapped(content, ranges) {
|
|
45
34
|
if (ranges.length !== 1)
|
|
@@ -49,30 +38,27 @@ function isEntireFileWrapped(content, ranges) {
|
|
|
49
38
|
const after = content.slice(block.closeEnd);
|
|
50
39
|
return !/\S/.test(before) && !/\S/.test(after);
|
|
51
40
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
41
|
+
function findEmptyHeadings(tree, content, ranges) {
|
|
42
|
+
var _a, _b;
|
|
43
|
+
const headings = [];
|
|
44
|
+
(0, unist_util_visit_1.default)(tree, 'heading', (node) => {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
const offset = (_b = (_a = node.position) === null || _a === void 0 ? void 0 : _a.start) === null || _b === void 0 ? void 0 : _b.offset;
|
|
47
|
+
if (offset !== undefined && !isInsideRange(offset, ranges)) {
|
|
48
|
+
headings.push(node);
|
|
59
49
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
: content.length;
|
|
68
|
-
const headingLine = content.slice(sectionStart, content.indexOf('\n', sectionStart));
|
|
69
|
-
const afterHeading = content.slice(sectionStart + headingLine.length, sectionEnd);
|
|
70
|
-
const stripped = stripFilteredBlocks(afterHeading, ranges, sectionStart + headingLine.length);
|
|
50
|
+
});
|
|
51
|
+
const emptyHeadings = [];
|
|
52
|
+
for (let i = 0; i < headings.length; i++) {
|
|
53
|
+
const sectionStart = headings[i].position.end.offset;
|
|
54
|
+
const sectionEnd = (_b = (_a = headings[i + 1]) === null || _a === void 0 ? void 0 : _a.position.start.offset) !== null && _b !== void 0 ? _b : content.length;
|
|
55
|
+
const body = content.slice(sectionStart, sectionEnd);
|
|
56
|
+
const stripped = stripFilteredBlocks(body, ranges, sectionStart);
|
|
71
57
|
if (!/\S/.test(stripped)) {
|
|
72
|
-
|
|
58
|
+
emptyHeadings.push(headings[i]);
|
|
73
59
|
}
|
|
74
60
|
}
|
|
75
|
-
return
|
|
61
|
+
return emptyHeadings;
|
|
76
62
|
}
|
|
77
63
|
function stripFilteredBlocks(section, allRanges, sectionOffset) {
|
|
78
64
|
let result = section;
|
|
@@ -86,36 +72,35 @@ function stripFilteredBlocks(section, allRanges, sectionOffset) {
|
|
|
86
72
|
}
|
|
87
73
|
return result;
|
|
88
74
|
}
|
|
89
|
-
function
|
|
75
|
+
function validateTag(tree, file, raw, content, tagName) {
|
|
76
|
+
const ranges = findBlockRanges(content, tagName);
|
|
77
|
+
if (ranges.length === 0)
|
|
78
|
+
return;
|
|
79
|
+
for (const range of ranges) {
|
|
80
|
+
if (isNestedBlock(range, ranges)) {
|
|
81
|
+
file.message(`Redundant nested ${tagName} block — already inside a ${tagName} block.`, (0, sfdocs_liquid_lint_utils_1.offsetToPosition)(raw, range.openStart));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (isEntireFileWrapped(content, ranges)) {
|
|
85
|
+
file.message(`All content is inside ${tagName} block — use \`filters: [${tagName}]\` in TOC instead.`, (0, sfdocs_liquid_lint_utils_1.offsetToPosition)(raw, ranges[0].openStart));
|
|
86
|
+
}
|
|
87
|
+
for (const heading of findEmptyHeadings(tree, content, ranges)) {
|
|
88
|
+
file.message(`Heading would have no content after ${tagName} block is removed.`, heading);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function checkFilteredBlocks(tree, file, option) {
|
|
90
92
|
var _a;
|
|
91
|
-
|
|
93
|
+
const filterTags = option === null || option === void 0 ? void 0 : option.filterTags;
|
|
94
|
+
if (!file.path || !filterTags || filterTags.length === 0)
|
|
92
95
|
return;
|
|
93
96
|
const raw = String((_a = file.contents) !== null && _a !== void 0 ? _a : '');
|
|
94
97
|
if (!raw)
|
|
95
98
|
return;
|
|
96
|
-
const
|
|
97
|
-
if (!
|
|
99
|
+
const parsed = (0, sfdocs_liquid_lint_utils_1.parseFrontmatter)(raw);
|
|
100
|
+
if (!parsed)
|
|
98
101
|
return;
|
|
99
|
-
const content = (0, sfdocs_liquid_lint_utils_1.protectCodeBlocks)(raw);
|
|
100
102
|
for (const tagName of filterTags) {
|
|
101
|
-
|
|
102
|
-
if (ranges.length === 0)
|
|
103
|
-
continue;
|
|
104
|
-
for (let i = 0; i < ranges.length; i++) {
|
|
105
|
-
if (isNestedBlock(i, ranges)) {
|
|
106
|
-
const position = (0, sfdocs_liquid_lint_utils_1.offsetToPosition)(raw, ranges[i].openStart);
|
|
107
|
-
file.message(`Redundant nested ${tagName} block — already inside a ${tagName} block.`, position);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
if (isEntireFileWrapped(content, ranges)) {
|
|
111
|
-
const position = (0, sfdocs_liquid_lint_utils_1.offsetToPosition)(raw, ranges[0].openStart);
|
|
112
|
-
file.message(`All content is inside ${tagName} block — use \`filters: [${tagName}]\` in TOC instead.`, position);
|
|
113
|
-
}
|
|
114
|
-
const emptyHeadingOffsets = findEmptySections(content, ranges);
|
|
115
|
-
for (const offset of emptyHeadingOffsets) {
|
|
116
|
-
const position = (0, sfdocs_liquid_lint_utils_1.offsetToPosition)(raw, offset);
|
|
117
|
-
file.message(`Heading would have no content after ${tagName} block is removed.`, position);
|
|
118
|
-
}
|
|
103
|
+
validateTag(tree, file, raw, parsed.content, tagName);
|
|
119
104
|
}
|
|
120
105
|
}
|
|
121
106
|
module.exports = (0, unified_lint_rule_1.default)(SOURCE, checkFilteredBlocks);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,0EAAqC;AAErC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,0EAAqC;AACrC,wEAAqC;AAErC,uFAA8F;AAE9F,MAAM,MAAM,GAAG,2CAA2C,CAAC;AAO3D,SAAS,eAAe,CAAC,OAAe,EAAE,OAAe;IACrD,MAAM,MAAM,GAAiB,EAAE,CAAC;IAChC,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,YAAY,OAAO,OAAO,OAAO,WAAW,EAAE,GAAG,CAAC,CAAC;IAC5E,MAAM,gBAAgB,GAAa,EAAE,CAAC;IAEtC,IAAI,KAA6B,CAAC;IAClC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,IAAI,EAAE;QAC3C,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;YACtB,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACtC;aAAM,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;YACpC,MAAM,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IAAI,CAAC,OAAO,CACR,uCAAuC,OAAO,oBAAoB,EAClE,OAAO,CACV,CAAC;KACL;AACL,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAS,EAAE,IAAW,EAAE,MAAkC;;IACnF,MAAM,UAAU,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,CAAC;IACtC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAEjE,MAAM,GAAG,GAAG,MAAM,CAAC,MAAA,IAAI,CAAC,QAAQ,mCAAI,EAAE,CAAC,CAAC;IACxC,IAAI,CAAC,GAAG;QAAE,OAAO;IAEjB,MAAM,MAAM,GAAG,IAAA,2CAAgB,EAAC,GAAG,CAAC,CAAC;IACrC,IAAI,CAAC,MAAM;QAAE,OAAO;IAEpB,KAAK,MAAM,OAAO,IAAI,UAAU,EAAE;QAC9B,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;KACzD;AACL,CAAC;AAED,iBAAS,IAAA,2BAAI,EAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/sfdocs-liquid-lint-filtered-blocks",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1-alpha.2",
|
|
4
4
|
"description": "Validates structural issues in liquid filter blocks (englishonly, future, etc.).",
|
|
5
5
|
"author": "SFDocs Team",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@salesforcedevs/sfdocs-liquid-lint-utils": "1.0.
|
|
17
|
+
"@salesforcedevs/sfdocs-liquid-lint-utils": "1.0.2-alpha.2",
|
|
18
18
|
"unified-lint-rule": "^1.0.6",
|
|
19
|
+
"unist-util-visit": "^2.0.3",
|
|
19
20
|
"vfile": "^4.2.1"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import dedent from 'dedent';
|
|
2
2
|
import remark from 'remark';
|
|
3
|
+
import frontmatter from 'remark-frontmatter';
|
|
3
4
|
import unified from 'unified';
|
|
4
5
|
import vfile, { VFile } from 'vfile';
|
|
5
6
|
|
|
@@ -9,6 +10,7 @@ const PAGE_PATH = '/repo/content/en-us/project/guides/page.md';
|
|
|
9
10
|
|
|
10
11
|
const run = (md: string, options?: any, p = PAGE_PATH): VFile =>
|
|
11
12
|
remark()
|
|
13
|
+
.use(frontmatter)
|
|
12
14
|
.use(plugin as unified.Attacher, options)
|
|
13
15
|
.processSync(vfile({ path: p, contents: md }));
|
|
14
16
|
|
|
@@ -46,21 +48,6 @@ describe('sfdocs-lint:liquid-filtered-blocks', () => {
|
|
|
46
48
|
expect(run(md, { filterTags: ['englishonly'] }).messages).toHaveLength(0);
|
|
47
49
|
});
|
|
48
50
|
|
|
49
|
-
test('no messages for valid future block', () => {
|
|
50
|
-
const md = dedent`
|
|
51
|
-
# Heading
|
|
52
|
-
|
|
53
|
-
Regular content.
|
|
54
|
-
|
|
55
|
-
{% future %}
|
|
56
|
-
Future content here.
|
|
57
|
-
{% endfuture %}
|
|
58
|
-
|
|
59
|
-
More content after.
|
|
60
|
-
`;
|
|
61
|
-
expect(run(md, { filterTags: ['future'] }).messages).toHaveLength(0);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
51
|
test('warns on nested same-tag blocks (englishonly)', () => {
|
|
65
52
|
const md = dedent`
|
|
66
53
|
{% englishonly %}
|
|
@@ -81,66 +68,26 @@ describe('sfdocs-lint:liquid-filtered-blocks', () => {
|
|
|
81
68
|
expect(messages[0].ruleId).toBe('liquid-filtered-blocks');
|
|
82
69
|
});
|
|
83
70
|
|
|
84
|
-
test('warns
|
|
71
|
+
test('warns when entire file is wrapped', () => {
|
|
85
72
|
const md = dedent`
|
|
86
|
-
{%
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
{% future %}
|
|
90
|
-
Inner.
|
|
91
|
-
{% endfuture %}
|
|
73
|
+
{% englishonly %}
|
|
74
|
+
# Full Content
|
|
92
75
|
|
|
93
|
-
|
|
76
|
+
Everything here.
|
|
77
|
+
{% endenglishonly %}
|
|
94
78
|
`;
|
|
95
|
-
const messages = run(md, { filterTags: ['
|
|
79
|
+
const messages = run(md, { filterTags: ['englishonly'] }).messages;
|
|
96
80
|
expect(messages).toHaveLength(1);
|
|
97
81
|
expect(messages[0].message).toBe(
|
|
98
|
-
'
|
|
82
|
+
'All content is inside englishonly block — use `filters: [englishonly]` in TOC instead.',
|
|
99
83
|
);
|
|
100
84
|
});
|
|
101
85
|
|
|
102
|
-
test('
|
|
103
|
-
const md = dedent`
|
|
104
|
-
# Heading
|
|
105
|
-
|
|
106
|
-
Regular content.
|
|
107
|
-
|
|
108
|
-
{% future %}
|
|
109
|
-
Future content.
|
|
110
|
-
|
|
111
|
-
{% englishonly %}
|
|
112
|
-
English-only inside future.
|
|
113
|
-
{% endenglishonly %}
|
|
114
|
-
|
|
115
|
-
{% endfuture %}
|
|
116
|
-
|
|
117
|
-
More content.
|
|
118
|
-
`;
|
|
119
|
-
expect(run(md, { filterTags: ['englishonly', 'future'] }).messages).toHaveLength(0);
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
test('does NOT warn on cross-tag nesting (future inside englishonly)', () => {
|
|
123
|
-
const md = dedent`
|
|
124
|
-
# Heading
|
|
125
|
-
|
|
126
|
-
Regular content.
|
|
127
|
-
|
|
128
|
-
{% englishonly %}
|
|
129
|
-
English content.
|
|
130
|
-
|
|
131
|
-
{% future %}
|
|
132
|
-
Future inside english.
|
|
133
|
-
{% endfuture %}
|
|
134
|
-
|
|
135
|
-
{% endenglishonly %}
|
|
136
|
-
|
|
137
|
-
More content.
|
|
138
|
-
`;
|
|
139
|
-
expect(run(md, { filterTags: ['englishonly', 'future'] }).messages).toHaveLength(0);
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
test('warns when entire file is wrapped', () => {
|
|
86
|
+
test('warns when entire file is wrapped even with frontmatter', () => {
|
|
143
87
|
const md = dedent`
|
|
88
|
+
---
|
|
89
|
+
title: My Topic
|
|
90
|
+
---
|
|
144
91
|
{% englishonly %}
|
|
145
92
|
# Full Content
|
|
146
93
|
|
|
@@ -162,18 +109,18 @@ describe('sfdocs-lint:liquid-filtered-blocks', () => {
|
|
|
162
109
|
|
|
163
110
|
## Empty Section
|
|
164
111
|
|
|
165
|
-
{%
|
|
112
|
+
{% englishonly %}
|
|
166
113
|
This is the only content under this heading.
|
|
167
|
-
{%
|
|
114
|
+
{% endenglishonly %}
|
|
168
115
|
|
|
169
116
|
## Another Section
|
|
170
117
|
|
|
171
118
|
More regular content.
|
|
172
119
|
`;
|
|
173
|
-
const messages = run(md, { filterTags: ['
|
|
120
|
+
const messages = run(md, { filterTags: ['englishonly'] }).messages;
|
|
174
121
|
expect(messages).toHaveLength(1);
|
|
175
122
|
expect(messages[0].message).toBe(
|
|
176
|
-
'Heading would have no content after
|
|
123
|
+
'Heading would have no content after englishonly block is removed.',
|
|
177
124
|
);
|
|
178
125
|
});
|
|
179
126
|
|
|
@@ -192,15 +139,15 @@ describe('sfdocs-lint:liquid-filtered-blocks', () => {
|
|
|
192
139
|
|
|
193
140
|
test('handles whitespace-control syntax', () => {
|
|
194
141
|
const md = dedent`
|
|
195
|
-
{%-
|
|
196
|
-
{%-
|
|
142
|
+
{%- englishonly -%}
|
|
143
|
+
{%- englishonly -%}
|
|
197
144
|
Nested.
|
|
198
|
-
{%-
|
|
199
|
-
{%-
|
|
145
|
+
{%- endenglishonly -%}
|
|
146
|
+
{%- endenglishonly -%}
|
|
200
147
|
`;
|
|
201
|
-
const messages = run(md, { filterTags: ['
|
|
148
|
+
const messages = run(md, { filterTags: ['englishonly'] }).messages;
|
|
202
149
|
expect(messages).toHaveLength(1);
|
|
203
|
-
expect(messages[0].message).toContain('Redundant nested
|
|
150
|
+
expect(messages[0].message).toContain('Redundant nested englishonly block');
|
|
204
151
|
});
|
|
205
152
|
|
|
206
153
|
test('ignores tags inside fenced code blocks', () => {
|
|
@@ -228,7 +175,7 @@ describe('sfdocs-lint:liquid-filtered-blocks', () => {
|
|
|
228
175
|
Content.
|
|
229
176
|
{% endenglishonly %}
|
|
230
177
|
`;
|
|
231
|
-
const messages = run(md, { filterTags: ['englishonly'
|
|
178
|
+
const messages = run(md, { filterTags: ['englishonly'] }).messages;
|
|
232
179
|
expect(messages).toHaveLength(1);
|
|
233
180
|
expect(messages[0].message).toContain('englishonly');
|
|
234
181
|
});
|
package/src/index.ts
CHANGED
|
@@ -1,35 +1,27 @@
|
|
|
1
1
|
import rule from 'unified-lint-rule';
|
|
2
|
+
import visit from 'unist-util-visit';
|
|
2
3
|
import { VFile } from 'vfile';
|
|
3
|
-
import { offsetToPosition,
|
|
4
|
+
import { offsetToPosition, parseFrontmatter } from '@salesforcedevs/sfdocs-liquid-lint-utils';
|
|
4
5
|
|
|
5
6
|
const SOURCE = 'sfdocs-liquid-lint:liquid-filtered-blocks';
|
|
6
7
|
|
|
7
|
-
interface FilteredBlocksOptions {
|
|
8
|
-
filterTags?: string[];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
8
|
interface BlockRange {
|
|
12
9
|
openStart: number;
|
|
13
|
-
openEnd: number;
|
|
14
|
-
closeStart: number;
|
|
15
10
|
closeEnd: number;
|
|
16
11
|
}
|
|
17
12
|
|
|
18
13
|
function findBlockRanges(content: string, tagName: string): BlockRange[] {
|
|
19
14
|
const ranges: BlockRange[] = [];
|
|
20
15
|
const tagRe = new RegExp(`{%-?\\s*(${tagName}|end${tagName})\\s*-?%}`, 'g');
|
|
21
|
-
const
|
|
16
|
+
const unmatchedOpeners: number[] = [];
|
|
22
17
|
|
|
23
18
|
let match: RegExpExecArray | null;
|
|
24
19
|
while ((match = tagRe.exec(content)) !== null) {
|
|
25
20
|
if (match[1] === tagName) {
|
|
26
|
-
|
|
27
|
-
} else if (
|
|
28
|
-
const open = openStack.pop()!;
|
|
21
|
+
unmatchedOpeners.push(match.index);
|
|
22
|
+
} else if (unmatchedOpeners.length > 0) {
|
|
29
23
|
ranges.push({
|
|
30
|
-
openStart:
|
|
31
|
-
openEnd: open.end,
|
|
32
|
-
closeStart: match.index,
|
|
24
|
+
openStart: unmatchedOpeners.pop()!,
|
|
33
25
|
closeEnd: match.index + match[0].length,
|
|
34
26
|
});
|
|
35
27
|
}
|
|
@@ -41,16 +33,8 @@ function isInsideRange(offset: number, ranges: BlockRange[]): boolean {
|
|
|
41
33
|
return ranges.some(r => offset >= r.openStart && offset < r.closeEnd);
|
|
42
34
|
}
|
|
43
35
|
|
|
44
|
-
function isNestedBlock(
|
|
45
|
-
|
|
46
|
-
for (let i = 0; i < ranges.length; i++) {
|
|
47
|
-
if (i === blockIndex) continue;
|
|
48
|
-
const outer = ranges[i];
|
|
49
|
-
if (block.openStart > outer.openStart && block.closeEnd < outer.closeEnd) {
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return false;
|
|
36
|
+
function isNestedBlock(block: BlockRange, ranges: BlockRange[]): boolean {
|
|
37
|
+
return ranges.some(r => r !== block && block.openStart > r.openStart && block.closeEnd < r.closeEnd);
|
|
54
38
|
}
|
|
55
39
|
|
|
56
40
|
function isEntireFileWrapped(content: string, ranges: BlockRange[]): boolean {
|
|
@@ -61,34 +45,27 @@ function isEntireFileWrapped(content: string, ranges: BlockRange[]): boolean {
|
|
|
61
45
|
return !/\S/.test(before) && !/\S/.test(after);
|
|
62
46
|
}
|
|
63
47
|
|
|
64
|
-
function
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (/^#{1,6}\s+\S/.test(line) && !isInsideRange(offset, ranges)) {
|
|
71
|
-
headingPositions.push(offset);
|
|
48
|
+
function findEmptyHeadings(tree: any, content: string, ranges: BlockRange[]): any[] {
|
|
49
|
+
const headings: any[] = [];
|
|
50
|
+
visit(tree, 'heading', (node: any) => {
|
|
51
|
+
const offset = node.position?.start?.offset;
|
|
52
|
+
if (offset !== undefined && !isInsideRange(offset, ranges)) {
|
|
53
|
+
headings.push(node);
|
|
72
54
|
}
|
|
73
|
-
|
|
74
|
-
}
|
|
55
|
+
});
|
|
75
56
|
|
|
76
|
-
const
|
|
77
|
-
for (let i = 0; i <
|
|
78
|
-
const sectionStart =
|
|
79
|
-
const sectionEnd = i + 1
|
|
80
|
-
|
|
81
|
-
: content.length;
|
|
57
|
+
const emptyHeadings: any[] = [];
|
|
58
|
+
for (let i = 0; i < headings.length; i++) {
|
|
59
|
+
const sectionStart = headings[i].position.end.offset;
|
|
60
|
+
const sectionEnd = headings[i + 1]?.position.start.offset ?? content.length;
|
|
61
|
+
const body = content.slice(sectionStart, sectionEnd);
|
|
82
62
|
|
|
83
|
-
const
|
|
84
|
-
const afterHeading = content.slice(sectionStart + headingLine.length, sectionEnd);
|
|
85
|
-
|
|
86
|
-
const stripped = stripFilteredBlocks(afterHeading, ranges, sectionStart + headingLine.length);
|
|
63
|
+
const stripped = stripFilteredBlocks(body, ranges, sectionStart);
|
|
87
64
|
if (!/\S/.test(stripped)) {
|
|
88
|
-
|
|
65
|
+
emptyHeadings.push(headings[i]);
|
|
89
66
|
}
|
|
90
67
|
}
|
|
91
|
-
return
|
|
68
|
+
return emptyHeadings;
|
|
92
69
|
}
|
|
93
70
|
|
|
94
71
|
function stripFilteredBlocks(section: string, allRanges: BlockRange[], sectionOffset: number): string {
|
|
@@ -105,46 +82,46 @@ function stripFilteredBlocks(section: string, allRanges: BlockRange[], sectionOf
|
|
|
105
82
|
return result;
|
|
106
83
|
}
|
|
107
84
|
|
|
108
|
-
function
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
if (!raw) return;
|
|
112
|
-
|
|
113
|
-
const filterTags = option?.filterTags;
|
|
114
|
-
if (!filterTags || filterTags.length === 0) return;
|
|
115
|
-
|
|
116
|
-
const content = protectCodeBlocks(raw);
|
|
85
|
+
function validateTag(tree: any, file: VFile, raw: string, content: string, tagName: string): void {
|
|
86
|
+
const ranges = findBlockRanges(content, tagName);
|
|
87
|
+
if (ranges.length === 0) return;
|
|
117
88
|
|
|
118
|
-
for (const
|
|
119
|
-
|
|
120
|
-
if (ranges.length === 0) continue;
|
|
121
|
-
|
|
122
|
-
for (let i = 0; i < ranges.length; i++) {
|
|
123
|
-
if (isNestedBlock(i, ranges)) {
|
|
124
|
-
const position = offsetToPosition(raw, ranges[i].openStart);
|
|
125
|
-
file.message(
|
|
126
|
-
`Redundant nested ${tagName} block — already inside a ${tagName} block.`,
|
|
127
|
-
position,
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (isEntireFileWrapped(content, ranges)) {
|
|
133
|
-
const position = offsetToPosition(raw, ranges[0].openStart);
|
|
89
|
+
for (const range of ranges) {
|
|
90
|
+
if (isNestedBlock(range, ranges)) {
|
|
134
91
|
file.message(
|
|
135
|
-
`
|
|
136
|
-
|
|
92
|
+
`Redundant nested ${tagName} block — already inside a ${tagName} block.`,
|
|
93
|
+
offsetToPosition(raw, range.openStart),
|
|
137
94
|
);
|
|
138
95
|
}
|
|
96
|
+
}
|
|
139
97
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
98
|
+
if (isEntireFileWrapped(content, ranges)) {
|
|
99
|
+
file.message(
|
|
100
|
+
`All content is inside ${tagName} block — use \`filters: [${tagName}]\` in TOC instead.`,
|
|
101
|
+
offsetToPosition(raw, ranges[0].openStart),
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
for (const heading of findEmptyHeadings(tree, content, ranges)) {
|
|
106
|
+
file.message(
|
|
107
|
+
`Heading would have no content after ${tagName} block is removed.`,
|
|
108
|
+
heading,
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function checkFilteredBlocks(tree: any, file: VFile, option?: { filterTags?: string[] }): void {
|
|
114
|
+
const filterTags = option?.filterTags;
|
|
115
|
+
if (!file.path || !filterTags || filterTags.length === 0) return;
|
|
116
|
+
|
|
117
|
+
const raw = String(file.contents ?? '');
|
|
118
|
+
if (!raw) return;
|
|
119
|
+
|
|
120
|
+
const parsed = parseFrontmatter(raw);
|
|
121
|
+
if (!parsed) return;
|
|
122
|
+
|
|
123
|
+
for (const tagName of filterTags) {
|
|
124
|
+
validateTag(tree, file, raw, parsed.content, tagName);
|
|
148
125
|
}
|
|
149
126
|
}
|
|
150
127
|
|
package/tsconfig.tsbuildinfo
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/@types/unist/index.d.ts","../../node_modules/vfile-message/types/index.d.ts","../../node_modules/vfile/types/index.d.ts","../liquid-lint-utils/dist/parse-frontmatter.d.ts","../liquid-lint-utils/dist/check-filtered-cross-references.d.ts","../liquid-lint-utils/dist/disabled-tags.d.ts","../liquid-lint-utils/dist/custom-block-tags.d.ts","../liquid-lint-utils/dist/is-liquid-enabled.d.ts","../liquid-lint-utils/dist/offset-to-position.d.ts","../liquid-lint-utils/dist/protect-code-blocks.d.ts","../liquid-lint-utils/dist/resolve-roots.d.ts","../liquid-lint-utils/dist/index.d.ts","./src/index.ts","./node_modules/@types/node/assert/strict.d.ts","./node_modules/@types/node/globals.d.ts","./node_modules/@types/node/async_hooks.d.ts","./node_modules/@types/node/buffer.d.ts","./node_modules/@types/node/child_process.d.ts","./node_modules/@types/node/cluster.d.ts","./node_modules/@types/node/console.d.ts","./node_modules/@types/node/constants.d.ts","./node_modules/@types/node/crypto.d.ts","./node_modules/@types/node/dgram.d.ts","./node_modules/@types/node/diagnostic_channel.d.ts","./node_modules/@types/node/dns.d.ts","./node_modules/@types/node/dns/promises.d.ts","./node_modules/@types/node/domain.d.ts","./node_modules/@types/node/events.d.ts","./node_modules/@types/node/fs.d.ts","./node_modules/@types/node/fs/promises.d.ts","./node_modules/@types/node/http.d.ts","./node_modules/@types/node/http2.d.ts","./node_modules/@types/node/https.d.ts","./node_modules/@types/node/inspector.d.ts","./node_modules/@types/node/module.d.ts","./node_modules/@types/node/net.d.ts","./node_modules/@types/node/os.d.ts","./node_modules/@types/node/path.d.ts","./node_modules/@types/node/perf_hooks.d.ts","./node_modules/@types/node/process.d.ts","./node_modules/@types/node/punycode.d.ts","./node_modules/@types/node/querystring.d.ts","./node_modules/@types/node/readline.d.ts","./node_modules/@types/node/repl.d.ts","./node_modules/@types/node/stream.d.ts","./node_modules/@types/node/stream/promises.d.ts","./node_modules/@types/node/string_decoder.d.ts","./node_modules/@types/node/timers.d.ts","./node_modules/@types/node/timers/promises.d.ts","./node_modules/@types/node/tls.d.ts","./node_modules/@types/node/trace_events.d.ts","./node_modules/@types/node/tty.d.ts","./node_modules/@types/node/url.d.ts","./node_modules/@types/node/util.d.ts","./node_modules/@types/node/util/types.d.ts","./node_modules/@types/node/v8.d.ts","./node_modules/@types/node/vm.d.ts","./node_modules/@types/node/worker_threads.d.ts","./node_modules/@types/node/zlib.d.ts","./node_modules/@types/node/globals.global.d.ts","./node_modules/@types/node/wasi.d.ts","./node_modules/@types/node/ts3.6/base.d.ts","./node_modules/@types/node/assert.d.ts","./node_modules/@types/node/base.d.ts","./node_modules/@types/node/index.d.ts","../../node_modules/@babel/types/lib/index.d.ts","../../node_modules/@types/babel__generator/index.d.ts","../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../node_modules/@types/babel__template/index.d.ts","../../node_modules/@types/babel__traverse/index.d.ts","../../node_modules/@types/babel__core/index.d.ts","../../node_modules/keyv/src/index.d.ts","../../node_modules/@types/http-cache-semantics/index.d.ts","../../node_modules/@types/responselike/index.d.ts","../../node_modules/@types/cacheable-request/index.d.ts","../../node_modules/@types/dedent/index.d.ts","../../node_modules/@types/graceful-fs/index.d.ts","../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../node_modules/@types/istanbul-lib-report/index.d.ts","../../node_modules/@types/istanbul-reports/index.d.ts","../../node_modules/@types/jest/node_modules/jest-diff/build/cleanupsemantic.d.ts","../../node_modules/@types/jest/node_modules/jest-diff/build/types.d.ts","../../node_modules/@types/jest/node_modules/jest-diff/build/difflines.d.ts","../../node_modules/@types/jest/node_modules/jest-diff/build/printdiffs.d.ts","../../node_modules/@types/jest/node_modules/jest-diff/build/index.d.ts","../../node_modules/@types/jest/node_modules/pretty-format/build/types.d.ts","../../node_modules/@types/jest/node_modules/pretty-format/build/index.d.ts","../../node_modules/@types/jest/index.d.ts","../../node_modules/@types/jest/ts3.2/index.d.ts","../../node_modules/@types/js-yaml/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/jsonpath-plus/index.d.ts","../../node_modules/@types/keyv/index.d.ts","../../node_modules/@types/mdast/index.d.ts","../../node_modules/@types/minimatch/index.d.ts","../../node_modules/@types/minimist/index.d.ts","../../node_modules/@types/mock-fs/lib/item.d.ts","../../node_modules/@types/mock-fs/lib/file.d.ts","../../node_modules/@types/mock-fs/lib/directory.d.ts","../../node_modules/@types/mock-fs/lib/symlink.d.ts","../../node_modules/@types/mock-fs/lib/filesystem.d.ts","../../node_modules/@types/mock-fs/index.d.ts","../../node_modules/@types/normalize-package-data/index.d.ts","../../node_modules/@types/prettier/index.d.ts","../../node_modules/@types/stack-utils/index.d.ts","../../node_modules/@types/yargs-parser/index.d.ts","../../node_modules/@types/yargs/index.d.ts","../../../node_modules/@types/mute-stream/index.d.ts","../../../node_modules/@types/wrap-ansi/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18",{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"6d09838b65c3c780513878793fc394ae29b8595d9e4729246d14ce69abc71140","eb09cf44043f7d6e0208dca6f0555207015e91fff5ff77b9c21d63672f7d68d5","bbf6f246061b92bb84241897eebfcdb9ce28444ab6acbc32c425388dd27c1011","55fb7da9a36a3d45502aa14b33c55e4f3baa96567978c189a7d6e4dbbfe6cd2d","7b60a10987d3733d2652c5509808f81229ed271bb010a37a6b355c4a7da86eda","36300e1494e25976af66784b85d7bf45afd4d5c71162db0350a603ae0e9e20c8","351422f596d51f45a23bb73b01f4e5bb200fc1435bf99226c1ea49f361404cd1","d4ffd5feb926ecddba6ff81487d9c7d6f4c759620f5145ceea6189671b6fe25d","a08c13d8c556d1c14bcd59d91e87b7e4693979db65c600ff33a069d4aa2df53e","3078a8fa4448f802b3a522b8170be54b14bf3563ac8904504a3304777b1540ff","9860ced5ed4a2a5cd4b994721d82efdf0ec1ae8b6c722a7aa95b0087ac3732aa","612dc3c34b2ef0d24fdc66f83539bd108e341df60a9ac6e68c6ff76dd7f56322",{"version":"a9143aa9415bb4b6938ede73c35527f8e9d753edc6cda05d6183f1cddc6f13c7","signature":"5e9d9d2e7b23697c2870a91d308db582f4cf6c6f6113cec425f7ff190a24f120"},"c7bdc99177a2a94d25fb13722adaaf5b3291bf70b4d1b27584ba189dd3889ba3",{"version":"d1c92b66c4105659fcad4eb76a1481f7311033e117d0678a1ec545e8ddb8d4c6","affectsGlobalScope":true},"e23424b97418eca3226fd24de079f1203eb70360622e4e093af2aff14d4be6ec","dee93c07b4df5e26010dc9ec4cdf4d6e4076bb4474d2a8371529217c8b2740a4","ed40f2f184db052dc8df62d1f199823c8bbccc487c0a2a7c54eeea0badcf4378","04eaa93bd75f937f9184dcb95a7983800c5770cf8ddd8ac0f3734dc02f5b20ef",{"version":"c8155caf28fc7b0a564156a5df28ad8a844a3bd32d331d148d8f3ce88025c870","affectsGlobalScope":true},"45ac321f2e15d268fd74a90ddaa6467dcaaff2c5b13f95b4b85831520fb7a491","dfc747ab8dd5f623055a4c26fd35e8cceca869fd3f1cf09701c941ca3679665a","c9f5f2920ff61d7158417b8440d5181ddc34a3dfef811a5677dd8a9fb91471e9","5cc0a492da3602510b8f5ed1852b1e0390002780d8758fbc8c0cd023ca7085f8","ec7dafafe751a5121f8f1c80201ebe7e7238c47e6329280a73c4d1ca4bb7fa28","64debeb10e4b7ae4ec9e89bfb4e04c6101ab98c3cc806d14e5488607cfec2753",{"version":"2866a528b2708aa272ec3eaafd3c980abb23aec1ef831cfc5eb2186b98c37ce5","affectsGlobalScope":true},{"version":"a5782d6cea81fe43d2db7ed41e789458c933ab3ab60602f7b5b14c4da3370496","affectsGlobalScope":true},"f258ba66915f0196ec344bc53afe1888240bbcc855ebd151b6cc072275533319","6194335ee3353f7226ba31f31d6301d0c6be87228419c0a08976ccd9d4f1213e","3ac12a54cfaa84683506db8d4cf779135a271d9f0ec18930cf53e61fbeea0c5d","cf3d3b087d1a8a3355eec47d206162c75e912315b9b5c1cd49fda93e948fb80a","36f316c066c4a72dd6f19fec49a074f935744fc9ccbe75c87ebc07fb2feb9062","42176966283d3835c34278b9b5c0f470d484c0c0c6a55c20a2c916a1ce69b6e8","0cff7901aedfe78e314f7d44088f07e2afa1b6e4f0473a4169b8456ca2fb245d","ec70fd6f8a9a83f850dab2960a6789e93d5b034b354a16814cad5daabf62a360","e2236264a811ed1d09a2487a433e8f5216ae62378cf233954ae220cf886f6717","3ec1e108d587a5661ec790db607f482605ba9f3830e118ce578e3ffa3c42e22b","100b3bb9d39d2b1b5340f1bf45a52e94ef1692b45232b4ba00fac5c3cc56d331",{"version":"04fe7e7d8008887943260af1fde2bfd4877e0dc57bf634e0f0b2f3d1794dfd11","affectsGlobalScope":true},"7f77304372efe3c9967e5f9ea2061f1b4bf41dc3cda3c83cdd676f2e5af6b7e6","992c6f6be16c0a1d2eec13ece33adeea2c747ba27fcd078353a8f4bb5b4fea58","2597718d91e306949d89e285bf34c44192014ef541c3bd7cbb825c022749e974","a6b0abdb67d63ebe964ba5fee31bc3daf10c12eecd46b24d778426010c04c67e","ac4801ebc2355ba32329070123b1cd15891bf71b41dcaf9e75b4744832126a59","fd2298fba0640e7295e7bd545e2dfbfcccbb00c27019e501c87965a02bbdebf6","4fd3c4debadce3e9ab9dec3eb45f7f5e2e3d4ad65cf975a6d938d883cfb25a50","71ddd49185b68f27bfac127ef5d22cb2672c278e53e5370d9020ef50ca9c377d","b1ea7a6eaa7608e0e0529aebd323b526a79c6c05a4e519ae5c779675004dcdf1","9fcb033a6208485d8f3fadde31eb5cbcaf99149cff3e40c0dc53ebc6d0dff4e9","7df562288f949945cf69c21cd912100c2afedeeb7cdb219085f7f4b46cb7dde4","9d16690485ff1eb4f6fc57aebe237728fd8e03130c460919da3a35f4d9bd97f5","dcc6910d95a3625fd2b0487fda055988e46ab46c357a1b3618c27b4a8dd739c9","f4149f1aa299474c7040a35fe8f8ac2ad078cc1b190415adc1fff3ed52d490ea","3730099ed008776216268a97771de31753ef71e0a7d0ec650f588cba2a06ce44","8d649dbc429d7139a1d9a14ea2bf8af1dc089e0a879447539587463d4b6c248c","60c9e27816ec8ac8df7240598bb086e95b47edfb454c5cbf4003c812e0ed6e39","e361aecf17fc4034b4c122a1564471cdcd22ef3a51407803cb5a5fc020c04d02","4926467de88a92a4fc9971d8c6f21b91eca1c0e7fc2a46cc4638ab9440c73875",{"version":"2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1","affectsGlobalScope":true},"fc0ae4a8ad3c762b96f9d2c3700cb879a373458cb0bf3175478e3b4f85f7ef2f","fabbec378e1ddd86fcf2662e716c2b8318acedb664ee3a4cba6f9e8ee8269cf1","b3593bd345ebea5e4d0a894c03251a3774b34df3d6db57075c18e089a599ba76","e61a21e9418f279bc480394a94d1581b2dee73747adcbdef999b6737e34d721b","efd55e8ca79171bf26c0d0e30221cb8ee1f5a31dd0c791ec4b2e886f42bab124","c2c2a861a338244d7dd700d0c52a78916b4bb75b98fc8ca5e7c501899fc03796","b6d03c9cfe2cf0ba4c673c209fcd7c46c815b2619fd2aad59fc4229aaef2ed43","adb467429462e3891de5bb4a82a4189b92005d61c7f9367c089baf03997c104e","670a76db379b27c8ff42f1ba927828a22862e2ab0b0908e38b671f0e912cc5ed","13b77ab19ef7aadd86a1e54f2f08ea23a6d74e102909e3c00d31f231ed040f62","069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","42baf4ca38c38deaf411ea73f37bc39ff56c6e5c761a968b64ac1b25c92b5cd8","d7dbe0ad36bdca8a6ecf143422a48e72cc8927bab7b23a1a2485c2f78a7022c6","8718fa41d7cf4aa91de4e8f164c90f88e0bf343aa92a1b9b725a9c675c64e16b","f992cd6cc0bcbaa4e6c810468c90f2d8595f8c6c3cf050c806397d3de8585562","3189093b3543e545bcf0e6d387d60c5cfe5a224b104d15b1639c0c4db9ecf012","afe73051ff6a03a9565cbd8ebb0e956ee3df5e913ad5c1ded64218aabfa3dcb5","035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","a4809f4d92317535e6b22b01019437030077a76fec1d93b9881c9ed4738fcc54","5f53fa0bd22096d2a78533f94e02c899143b8f0f9891a46965294ee8b91a9434","e222104af6cb9415238ad358488b74d76eceeff238c1268ec6e85655b05341da","69da61a7b5093dac77fa3bec8be95dcf9a74c95a0e9161edb98bb24e30e439d2","eba230221317c985ab1953ccc3edc517f248b37db4fef7875cb2c8d08aff7be7","b83e796810e475da3564c6515bc0ae9577070596a33d89299b7d99f94ecfd921","b4439890c168d646357928431100daac5cbdee1d345a34e6bf6eca9f3abe22bc","5d72971a459517c44c1379dab9ed248e87a61ba0a1e0f25c9d67e1e640cd9a09","02d734976af36f4273d930bea88b3e62adf6b078cf120c1c63d49aa8d8427c5c",{"version":"f624e578325b8c58e55b30c998b1f4c3ec1b61a9fa66373da4250c89b7880d44","affectsGlobalScope":true},{"version":"d3002f620eab4bf6476c9da5c0efb2041d46f7df8b3032a5631bd206abef2c75","affectsGlobalScope":true},"7a1dd1e9c8bf5e23129495b10718b280340c7500570e0cfe5cffcdee51e13e48","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","9bd81cfc874a2d896326e6d9e7a6963677389a8269b1d032663083b253e21162","fec943fdb3275eb6e006b35e04a8e2e99e9adf3f4b969ddf15315ac7575a93e4","202f8582ee3cd89e06c4a17d8aabb925ff8550370559c771d1cc3ec3934071c2","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fbca5ffaebf282ec3cdac47b0d1d4a138a8b0bb32105251a38acb235087d3318","b95f2a78de34a873c6dd76dc538b7a5fec77da6a0e0e7efc7aa58f58ddfce270","4b50f58fcf29daaeab0c583da58ee9731a4d5c003f99fd833d91ad99f19a82c3","6692416887d66b903aea54b32163d34318300772cd2b8c7c36f972937a62de74","3e640a0056177a4ccfb819d81b21c9ed0ac0e77d8b7bf580894a3392298a890b","b75cb207f8dfade4120ba3554c5781005c9de85723c76588befd47693342ca50","693c4c9acf5e1c56e30130a90e07bd05122e6194d69018b0b20c6581c1324e0a","22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","d88a5e779faf033be3d52142a04fbe1cb96009868e3bbdd296b2bc6c59e06c0e","ab82804a14454734010dcdcd43f564ff7b0389bee4c5692eec76ff5b30d4cf66","bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","ae271d475b632ce7b03fea6d9cf6da72439e57a109672671cbc79f54e1386938","dcefc29f25daf56cd69c0a3d3d19f51938efe1e6a15391950be43a76222ee3ed","24112d1a55250f4da7f9edb9dabeac8e3badebdf4a55b421fc7b8ca5ccc03133"],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"experimentalDecorators":true,"module":1,"noUnusedLocals":true,"outDir":"./dist","rootDir":"./src","skipLibCheck":true,"sourceMap":true,"strict":false,"target":6},"fileIdsList":[[79,99],[100],[100,101,102,103,104],[100,102],[62,65,87,99,106,107,108],[63,99],[112],[113],[119,121],[115,116],[115,116,117,118],[120],[122],[62,99],[35],[132,133,134,135],[131],[99,131],[131,132,133,134],[65,79,99],[140],[62],[35,36],[97],[96,97],[51,56],[62,63,70,79],[52,62,70],[88],[56,63,71],[79,84],[59,62,70],[60],[59],[62,64,79,87],[62,63,79],[70,79,87],[62,63,65,70,79,84,87],[65,79,84,87],[98],[87],[59,62,79],[72],[50],[86],[77,88,91],[62,80],[79],[82],[56,70],[48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95],[70],[76],[89],[51,56,62,64,73,79,87,91],[37,46],[37],[38,39,40,41,42,43,44,45]],"referencedMap":[[142,1],[102,2],[105,3],[101,2],[103,4],[104,2],[109,5],[111,6],[113,7],[114,8],[122,9],[117,10],[119,11],[118,10],[121,12],[123,13],[127,14],[128,15],[136,16],[133,17],[132,18],[135,19],[134,17],[108,20],[141,21],[106,22],[36,15],[37,23],[48,24],[98,25],[51,26],[52,27],[53,28],[54,29],[55,30],[56,31],[57,32],[59,33],[60,34],[61,22],[62,22],[63,35],[64,36],[65,37],[66,38],[67,39],[99,40],[68,22],[69,41],[70,42],[72,43],[73,44],[74,45],[77,22],[78,46],[79,47],[80,48],[82,22],[83,49],[84,50],[96,51],[86,52],[87,53],[88,54],[90,48],[92,55],[93,48],[47,56],[39,57],[46,58]],"exportedModulesMap":[[142,1],[102,2],[105,3],[101,2],[103,4],[104,2],[109,5],[111,6],[113,7],[114,8],[122,9],[117,10],[119,11],[118,10],[121,12],[123,13],[127,14],[128,15],[136,16],[133,17],[132,18],[135,19],[134,17],[108,20],[141,21],[106,22],[36,15],[37,23],[48,24],[98,25],[51,26],[52,27],[53,28],[54,29],[55,30],[56,31],[57,32],[59,33],[60,34],[61,22],[62,22],[63,35],[64,36],[65,37],[66,38],[67,39],[99,40],[68,22],[69,41],[70,42],[72,43],[73,44],[74,45],[77,22],[78,46],[79,47],[80,48],[82,22],[83,49],[84,50],[96,51],[86,52],[87,53],[88,54],[90,48],[92,55],[93,48],[39,57],[46,58]],"semanticDiagnosticsPerFile":[142,143,102,100,105,101,103,104,109,110,111,107,112,113,114,122,115,117,119,118,116,121,120,123,124,125,126,127,128,129,130,136,133,132,135,131,134,137,138,108,139,35,140,141,106,8,7,2,9,10,11,12,13,14,15,16,3,4,20,17,18,19,21,22,23,5,24,25,26,27,6,31,28,29,30,32,33,1,34,36,37,97,48,50,98,51,52,53,54,55,56,57,58,59,60,61,62,63,64,49,94,65,66,67,99,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,96,86,87,88,89,90,91,95,92,93,47,39,41,40,46,42,43,38,44,45],"latestChangedDtsFile":"./dist/index.d.ts"},"version":"4.9.5"}
|