prettier 4.0.0-alpha.7 → 4.0.0-alpha.8
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/LICENSE +1 -89
- package/index.cjs +158 -158
- package/index.mjs +15583 -15930
- package/internal/cli.mjs +1736 -1736
- package/package.json +2 -2
- package/plugins/acorn.js +7 -7
- package/plugins/acorn.mjs +7 -7
- package/plugins/babel.js +6 -6
- package/plugins/babel.mjs +6 -6
- package/plugins/estree.js +26 -26
- package/plugins/estree.mjs +26 -26
- package/plugins/flow.js +5 -5
- package/plugins/flow.mjs +5 -5
- package/plugins/glimmer.js +14 -14
- package/plugins/glimmer.mjs +14 -14
- package/plugins/graphql.js +12 -12
- package/plugins/graphql.mjs +12 -12
- package/plugins/html.js +14 -14
- package/plugins/html.mjs +14 -14
- package/plugins/markdown.js +42 -42
- package/plugins/markdown.mjs +42 -42
- package/plugins/meriyah.js +5 -5
- package/plugins/meriyah.mjs +5 -5
- package/plugins/postcss.js +27 -27
- package/plugins/postcss.mjs +27 -27
- package/plugins/typescript.js +17 -17
- package/plugins/typescript.mjs +17 -17
- package/plugins/yaml.js +46 -46
- package/plugins/yaml.mjs +46 -46
- package/standalone.js +25 -25
- package/standalone.mjs +25 -25
package/LICENSE
CHANGED
|
@@ -1721,7 +1721,7 @@ Contributors:
|
|
|
1721
1721
|
|
|
1722
1722
|
----------------------------------------
|
|
1723
1723
|
|
|
1724
|
-
### flow-parser@v0.
|
|
1724
|
+
### flow-parser@v0.225.0
|
|
1725
1725
|
|
|
1726
1726
|
> JavaScript parser written in OCaml. Produces ESTree AST
|
|
1727
1727
|
|
|
@@ -2823,25 +2823,6 @@ Author: Isaac Z. Schlueter <i@izs.me>
|
|
|
2823
2823
|
|
|
2824
2824
|
----------------------------------------
|
|
2825
2825
|
|
|
2826
|
-
### map-age-cleaner@v0.1.3
|
|
2827
|
-
|
|
2828
|
-
> Automatically cleanup expired items in a Map
|
|
2829
|
-
|
|
2830
|
-
License: MIT
|
|
2831
|
-
Author: Sam Verschueren <sam.verschueren@gmail.com> (github.com/SamVerschueren)
|
|
2832
|
-
|
|
2833
|
-
> MIT License
|
|
2834
|
-
>
|
|
2835
|
-
> Copyright (c) Sam Verschueren <sam.verschueren@gmail.com> (github.com/SamVerschueren)
|
|
2836
|
-
>
|
|
2837
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
2838
|
-
>
|
|
2839
|
-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
2840
|
-
>
|
|
2841
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
2842
|
-
|
|
2843
|
-
----------------------------------------
|
|
2844
|
-
|
|
2845
2826
|
### markdown-escapes@v1.0.4
|
|
2846
2827
|
|
|
2847
2828
|
> List of escapable characters in markdown
|
|
@@ -2876,25 +2857,6 @@ Contributors:
|
|
|
2876
2857
|
|
|
2877
2858
|
----------------------------------------
|
|
2878
2859
|
|
|
2879
|
-
### mem@v9.0.2
|
|
2880
|
-
|
|
2881
|
-
> Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input
|
|
2882
|
-
|
|
2883
|
-
License: MIT
|
|
2884
|
-
Author: Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
2885
|
-
|
|
2886
|
-
> MIT License
|
|
2887
|
-
>
|
|
2888
|
-
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
2889
|
-
>
|
|
2890
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
2891
|
-
>
|
|
2892
|
-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
2893
|
-
>
|
|
2894
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
2895
|
-
|
|
2896
|
-
----------------------------------------
|
|
2897
|
-
|
|
2898
2860
|
### merge2@v1.4.1
|
|
2899
2861
|
|
|
2900
2862
|
> Merge multiple streams into one stream in sequence or parallel.
|
|
@@ -2996,25 +2958,6 @@ Contributors:
|
|
|
2996
2958
|
|
|
2997
2959
|
----------------------------------------
|
|
2998
2960
|
|
|
2999
|
-
### mimic-fn@v4.0.0
|
|
3000
|
-
|
|
3001
|
-
> Make a function mimic another one
|
|
3002
|
-
|
|
3003
|
-
License: MIT
|
|
3004
|
-
Author: Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
3005
|
-
|
|
3006
|
-
> MIT License
|
|
3007
|
-
>
|
|
3008
|
-
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
3009
|
-
>
|
|
3010
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
3011
|
-
>
|
|
3012
|
-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
3013
|
-
>
|
|
3014
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
3015
|
-
|
|
3016
|
-
----------------------------------------
|
|
3017
|
-
|
|
3018
2961
|
### minimatch@v3.1.2
|
|
3019
2962
|
|
|
3020
2963
|
> a glob matcher in javascript
|
|
@@ -3158,37 +3101,6 @@ Author: Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)
|
|
|
3158
3101
|
|
|
3159
3102
|
----------------------------------------
|
|
3160
3103
|
|
|
3161
|
-
### p-defer@v1.0.0
|
|
3162
|
-
|
|
3163
|
-
> Create a deferred promise
|
|
3164
|
-
|
|
3165
|
-
License: MIT
|
|
3166
|
-
Author: Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
3167
|
-
|
|
3168
|
-
> The MIT License (MIT)
|
|
3169
|
-
>
|
|
3170
|
-
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
3171
|
-
>
|
|
3172
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
3173
|
-
> of this software and associated documentation files (the "Software"), to deal
|
|
3174
|
-
> in the Software without restriction, including without limitation the rights
|
|
3175
|
-
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
3176
|
-
> copies of the Software, and to permit persons to whom the Software is
|
|
3177
|
-
> furnished to do so, subject to the following conditions:
|
|
3178
|
-
>
|
|
3179
|
-
> The above copyright notice and this permission notice shall be included in
|
|
3180
|
-
> all copies or substantial portions of the Software.
|
|
3181
|
-
>
|
|
3182
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
3183
|
-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
3184
|
-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
3185
|
-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
3186
|
-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
3187
|
-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
3188
|
-
> THE SOFTWARE.
|
|
3189
|
-
|
|
3190
|
-
----------------------------------------
|
|
3191
|
-
|
|
3192
3104
|
### p-limit@v4.0.0
|
|
3193
3105
|
|
|
3194
3106
|
> Run multiple promise-returning & async functions with limited concurrency
|
package/index.cjs
CHANGED
|
@@ -33,6 +33,42 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
));
|
|
34
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
35
|
|
|
36
|
+
// src/utils/skip.js
|
|
37
|
+
function skip(characters) {
|
|
38
|
+
return (text, startIndex, options) => {
|
|
39
|
+
const backwards = Boolean(options == null ? void 0 : options.backwards);
|
|
40
|
+
if (startIndex === false) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
const { length } = text;
|
|
44
|
+
let cursor = startIndex;
|
|
45
|
+
while (cursor >= 0 && cursor < length) {
|
|
46
|
+
const character = text.charAt(cursor);
|
|
47
|
+
if (characters instanceof RegExp) {
|
|
48
|
+
if (!characters.test(character)) {
|
|
49
|
+
return cursor;
|
|
50
|
+
}
|
|
51
|
+
} else if (!characters.includes(character)) {
|
|
52
|
+
return cursor;
|
|
53
|
+
}
|
|
54
|
+
backwards ? cursor-- : cursor++;
|
|
55
|
+
}
|
|
56
|
+
if (cursor === -1 || cursor === length) {
|
|
57
|
+
return cursor;
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
var skipWhitespace, skipSpaces, skipToLineEnd, skipEverythingButNewLine;
|
|
63
|
+
var init_skip = __esm({
|
|
64
|
+
"src/utils/skip.js"() {
|
|
65
|
+
skipWhitespace = skip(/\s/);
|
|
66
|
+
skipSpaces = skip(" ");
|
|
67
|
+
skipToLineEnd = skip(",; ");
|
|
68
|
+
skipEverythingButNewLine = skip(/[^\n\r]/);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
36
72
|
// src/utils/skip-inline-comment.js
|
|
37
73
|
function skipInlineComment(text, startIndex) {
|
|
38
74
|
if (startIndex === false) {
|
|
@@ -85,42 +121,6 @@ var init_skip_newline = __esm({
|
|
|
85
121
|
}
|
|
86
122
|
});
|
|
87
123
|
|
|
88
|
-
// src/utils/skip.js
|
|
89
|
-
function skip(characters) {
|
|
90
|
-
return (text, startIndex, options) => {
|
|
91
|
-
const backwards = Boolean(options == null ? void 0 : options.backwards);
|
|
92
|
-
if (startIndex === false) {
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
const { length } = text;
|
|
96
|
-
let cursor = startIndex;
|
|
97
|
-
while (cursor >= 0 && cursor < length) {
|
|
98
|
-
const character = text.charAt(cursor);
|
|
99
|
-
if (characters instanceof RegExp) {
|
|
100
|
-
if (!characters.test(character)) {
|
|
101
|
-
return cursor;
|
|
102
|
-
}
|
|
103
|
-
} else if (!characters.includes(character)) {
|
|
104
|
-
return cursor;
|
|
105
|
-
}
|
|
106
|
-
backwards ? cursor-- : cursor++;
|
|
107
|
-
}
|
|
108
|
-
if (cursor === -1 || cursor === length) {
|
|
109
|
-
return cursor;
|
|
110
|
-
}
|
|
111
|
-
return false;
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
var skipWhitespace, skipSpaces, skipToLineEnd, skipEverythingButNewLine;
|
|
115
|
-
var init_skip = __esm({
|
|
116
|
-
"src/utils/skip.js"() {
|
|
117
|
-
skipWhitespace = skip(/\s/);
|
|
118
|
-
skipSpaces = skip(" ");
|
|
119
|
-
skipToLineEnd = skip(",; ");
|
|
120
|
-
skipEverythingButNewLine = skip(/[^\n\r]/);
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
|
|
124
124
|
// src/utils/skip-trailing-comment.js
|
|
125
125
|
function skipTrailingComment(text, startIndex) {
|
|
126
126
|
if (startIndex === false) {
|
|
@@ -155,32 +155,14 @@ function getNextNonSpaceNonCommentCharacterIndex(text, startIndex) {
|
|
|
155
155
|
var get_next_non_space_non_comment_character_index_default;
|
|
156
156
|
var init_get_next_non_space_non_comment_character_index = __esm({
|
|
157
157
|
"src/utils/get-next-non-space-non-comment-character-index.js"() {
|
|
158
|
+
init_skip();
|
|
158
159
|
init_skip_inline_comment();
|
|
159
160
|
init_skip_newline();
|
|
160
161
|
init_skip_trailing_comment();
|
|
161
|
-
init_skip();
|
|
162
162
|
get_next_non_space_non_comment_character_index_default = getNextNonSpaceNonCommentCharacterIndex;
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
165
|
|
|
166
|
-
// src/utils/is-previous-line-empty.js
|
|
167
|
-
function isPreviousLineEmpty(text, startIndex) {
|
|
168
|
-
let idx = startIndex - 1;
|
|
169
|
-
idx = skipSpaces(text, idx, { backwards: true });
|
|
170
|
-
idx = skip_newline_default(text, idx, { backwards: true });
|
|
171
|
-
idx = skipSpaces(text, idx, { backwards: true });
|
|
172
|
-
const idx2 = skip_newline_default(text, idx, { backwards: true });
|
|
173
|
-
return idx !== idx2;
|
|
174
|
-
}
|
|
175
|
-
var is_previous_line_empty_default;
|
|
176
|
-
var init_is_previous_line_empty = __esm({
|
|
177
|
-
"src/utils/is-previous-line-empty.js"() {
|
|
178
|
-
init_skip_newline();
|
|
179
|
-
init_skip();
|
|
180
|
-
is_previous_line_empty_default = isPreviousLineEmpty;
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
|
|
184
166
|
// src/utils/has-newline.js
|
|
185
167
|
function hasNewline(text, startIndex, options = {}) {
|
|
186
168
|
const idx = skipSpaces(
|
|
@@ -217,15 +199,112 @@ function isNextLineEmpty(text, startIndex) {
|
|
|
217
199
|
var is_next_line_empty_default;
|
|
218
200
|
var init_is_next_line_empty = __esm({
|
|
219
201
|
"src/utils/is-next-line-empty.js"() {
|
|
220
|
-
|
|
202
|
+
init_has_newline();
|
|
221
203
|
init_skip();
|
|
222
204
|
init_skip_inline_comment();
|
|
205
|
+
init_skip_newline();
|
|
223
206
|
init_skip_trailing_comment();
|
|
224
|
-
init_has_newline();
|
|
225
207
|
is_next_line_empty_default = isNextLineEmpty;
|
|
226
208
|
}
|
|
227
209
|
});
|
|
228
210
|
|
|
211
|
+
// src/utils/is-previous-line-empty.js
|
|
212
|
+
function isPreviousLineEmpty(text, startIndex) {
|
|
213
|
+
let idx = startIndex - 1;
|
|
214
|
+
idx = skipSpaces(text, idx, { backwards: true });
|
|
215
|
+
idx = skip_newline_default(text, idx, { backwards: true });
|
|
216
|
+
idx = skipSpaces(text, idx, { backwards: true });
|
|
217
|
+
const idx2 = skip_newline_default(text, idx, { backwards: true });
|
|
218
|
+
return idx !== idx2;
|
|
219
|
+
}
|
|
220
|
+
var is_previous_line_empty_default;
|
|
221
|
+
var init_is_previous_line_empty = __esm({
|
|
222
|
+
"src/utils/is-previous-line-empty.js"() {
|
|
223
|
+
init_skip();
|
|
224
|
+
init_skip_newline();
|
|
225
|
+
is_previous_line_empty_default = isPreviousLineEmpty;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
// src/main/comments/utils.js
|
|
230
|
+
function describeNodeForDebugging(node) {
|
|
231
|
+
const nodeType = node.type || node.kind || "(unknown type)";
|
|
232
|
+
let nodeName = String(
|
|
233
|
+
node.name || node.id && (typeof node.id === "object" ? node.id.name : node.id) || node.key && (typeof node.key === "object" ? node.key.name : node.key) || node.value && (typeof node.value === "object" ? "" : String(node.value)) || node.operator || ""
|
|
234
|
+
);
|
|
235
|
+
if (nodeName.length > 20) {
|
|
236
|
+
nodeName = nodeName.slice(0, 19) + "\u2026";
|
|
237
|
+
}
|
|
238
|
+
return nodeType + (nodeName ? " " + nodeName : "");
|
|
239
|
+
}
|
|
240
|
+
function addCommentHelper(node, comment) {
|
|
241
|
+
const comments = node.comments ?? (node.comments = []);
|
|
242
|
+
comments.push(comment);
|
|
243
|
+
comment.printed = false;
|
|
244
|
+
comment.nodeDescription = describeNodeForDebugging(node);
|
|
245
|
+
}
|
|
246
|
+
function addLeadingComment(node, comment) {
|
|
247
|
+
comment.leading = true;
|
|
248
|
+
comment.trailing = false;
|
|
249
|
+
addCommentHelper(node, comment);
|
|
250
|
+
}
|
|
251
|
+
function addDanglingComment(node, comment, marker) {
|
|
252
|
+
comment.leading = false;
|
|
253
|
+
comment.trailing = false;
|
|
254
|
+
if (marker) {
|
|
255
|
+
comment.marker = marker;
|
|
256
|
+
}
|
|
257
|
+
addCommentHelper(node, comment);
|
|
258
|
+
}
|
|
259
|
+
function addTrailingComment(node, comment) {
|
|
260
|
+
comment.leading = false;
|
|
261
|
+
comment.trailing = true;
|
|
262
|
+
addCommentHelper(node, comment);
|
|
263
|
+
}
|
|
264
|
+
var init_utils = __esm({
|
|
265
|
+
"src/main/comments/utils.js"() {
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
// src/utils/get-alignment-size.js
|
|
270
|
+
function getAlignmentSize(text, tabWidth, startIndex = 0) {
|
|
271
|
+
let size = 0;
|
|
272
|
+
for (let i = startIndex; i < text.length; ++i) {
|
|
273
|
+
if (text[i] === " ") {
|
|
274
|
+
size = size + tabWidth - size % tabWidth;
|
|
275
|
+
} else {
|
|
276
|
+
size++;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return size;
|
|
280
|
+
}
|
|
281
|
+
var get_alignment_size_default;
|
|
282
|
+
var init_get_alignment_size = __esm({
|
|
283
|
+
"src/utils/get-alignment-size.js"() {
|
|
284
|
+
get_alignment_size_default = getAlignmentSize;
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
// src/utils/get-indent-size.js
|
|
289
|
+
function getIndentSize(value, tabWidth) {
|
|
290
|
+
const lastNewlineIndex = value.lastIndexOf("\n");
|
|
291
|
+
if (lastNewlineIndex === -1) {
|
|
292
|
+
return 0;
|
|
293
|
+
}
|
|
294
|
+
return get_alignment_size_default(
|
|
295
|
+
// All the leading whitespaces
|
|
296
|
+
value.slice(lastNewlineIndex + 1).match(/^[\t ]*/)[0],
|
|
297
|
+
tabWidth
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
var get_indent_size_default;
|
|
301
|
+
var init_get_indent_size = __esm({
|
|
302
|
+
"src/utils/get-indent-size.js"() {
|
|
303
|
+
init_get_alignment_size();
|
|
304
|
+
get_indent_size_default = getIndentSize;
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
|
|
229
308
|
// node_modules/escape-string-regexp/index.js
|
|
230
309
|
function escapeStringRegexp(string) {
|
|
231
310
|
if (typeof string !== "string") {
|
|
@@ -259,6 +338,19 @@ var init_get_max_continuous_count = __esm({
|
|
|
259
338
|
}
|
|
260
339
|
});
|
|
261
340
|
|
|
341
|
+
// src/utils/get-next-non-space-non-comment-character.js
|
|
342
|
+
function getNextNonSpaceNonCommentCharacter(text, startIndex) {
|
|
343
|
+
const index = get_next_non_space_non_comment_character_index_default(text, startIndex);
|
|
344
|
+
return index === false ? "" : text.charAt(index);
|
|
345
|
+
}
|
|
346
|
+
var get_next_non_space_non_comment_character_default;
|
|
347
|
+
var init_get_next_non_space_non_comment_character = __esm({
|
|
348
|
+
"src/utils/get-next-non-space-non-comment-character.js"() {
|
|
349
|
+
init_get_next_non_space_non_comment_character_index();
|
|
350
|
+
get_next_non_space_non_comment_character_default = getNextNonSpaceNonCommentCharacter;
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
|
|
262
354
|
// node_modules/emoji-regex/index.mjs
|
|
263
355
|
var emoji_regex_default;
|
|
264
356
|
var init_emoji_regex = __esm({
|
|
@@ -322,45 +414,6 @@ var init_get_string_width = __esm({
|
|
|
322
414
|
}
|
|
323
415
|
});
|
|
324
416
|
|
|
325
|
-
// src/utils/get-alignment-size.js
|
|
326
|
-
function getAlignmentSize(text, tabWidth, startIndex = 0) {
|
|
327
|
-
let size = 0;
|
|
328
|
-
for (let i = startIndex; i < text.length; ++i) {
|
|
329
|
-
if (text[i] === " ") {
|
|
330
|
-
size = size + tabWidth - size % tabWidth;
|
|
331
|
-
} else {
|
|
332
|
-
size++;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
return size;
|
|
336
|
-
}
|
|
337
|
-
var get_alignment_size_default;
|
|
338
|
-
var init_get_alignment_size = __esm({
|
|
339
|
-
"src/utils/get-alignment-size.js"() {
|
|
340
|
-
get_alignment_size_default = getAlignmentSize;
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
// src/utils/get-indent-size.js
|
|
345
|
-
function getIndentSize(value, tabWidth) {
|
|
346
|
-
const lastNewlineIndex = value.lastIndexOf("\n");
|
|
347
|
-
if (lastNewlineIndex === -1) {
|
|
348
|
-
return 0;
|
|
349
|
-
}
|
|
350
|
-
return get_alignment_size_default(
|
|
351
|
-
// All the leading whitespaces
|
|
352
|
-
value.slice(lastNewlineIndex + 1).match(/^[\t ]*/)[0],
|
|
353
|
-
tabWidth
|
|
354
|
-
);
|
|
355
|
-
}
|
|
356
|
-
var get_indent_size_default;
|
|
357
|
-
var init_get_indent_size = __esm({
|
|
358
|
-
"src/utils/get-indent-size.js"() {
|
|
359
|
-
init_get_alignment_size();
|
|
360
|
-
get_indent_size_default = getIndentSize;
|
|
361
|
-
}
|
|
362
|
-
});
|
|
363
|
-
|
|
364
417
|
// src/utils/has-newline-in-range.js
|
|
365
418
|
function hasNewlineInRange(text, startIndex, endIndex) {
|
|
366
419
|
for (let i = startIndex; i < endIndex; ++i) {
|
|
@@ -394,19 +447,6 @@ var init_has_spaces = __esm({
|
|
|
394
447
|
}
|
|
395
448
|
});
|
|
396
449
|
|
|
397
|
-
// src/utils/get-next-non-space-non-comment-character.js
|
|
398
|
-
function getNextNonSpaceNonCommentCharacter(text, startIndex) {
|
|
399
|
-
const index = get_next_non_space_non_comment_character_index_default(text, startIndex);
|
|
400
|
-
return index === false ? "" : text.charAt(index);
|
|
401
|
-
}
|
|
402
|
-
var get_next_non_space_non_comment_character_default;
|
|
403
|
-
var init_get_next_non_space_non_comment_character = __esm({
|
|
404
|
-
"src/utils/get-next-non-space-non-comment-character.js"() {
|
|
405
|
-
init_get_next_non_space_non_comment_character_index();
|
|
406
|
-
get_next_non_space_non_comment_character_default = getNextNonSpaceNonCommentCharacter;
|
|
407
|
-
}
|
|
408
|
-
});
|
|
409
|
-
|
|
410
450
|
// scripts/build/shims/string-replace-all.js
|
|
411
451
|
var stringReplaceAll, string_replace_all_default;
|
|
412
452
|
var init_string_replace_all = __esm({
|
|
@@ -459,46 +499,6 @@ var init_make_string = __esm({
|
|
|
459
499
|
}
|
|
460
500
|
});
|
|
461
501
|
|
|
462
|
-
// src/main/comments/utils.js
|
|
463
|
-
function describeNodeForDebugging(node) {
|
|
464
|
-
const nodeType = node.type || node.kind || "(unknown type)";
|
|
465
|
-
let nodeName = String(
|
|
466
|
-
node.name || node.id && (typeof node.id === "object" ? node.id.name : node.id) || node.key && (typeof node.key === "object" ? node.key.name : node.key) || node.value && (typeof node.value === "object" ? "" : String(node.value)) || node.operator || ""
|
|
467
|
-
);
|
|
468
|
-
if (nodeName.length > 20) {
|
|
469
|
-
nodeName = nodeName.slice(0, 19) + "\u2026";
|
|
470
|
-
}
|
|
471
|
-
return nodeType + (nodeName ? " " + nodeName : "");
|
|
472
|
-
}
|
|
473
|
-
function addCommentHelper(node, comment) {
|
|
474
|
-
const comments = node.comments ?? (node.comments = []);
|
|
475
|
-
comments.push(comment);
|
|
476
|
-
comment.printed = false;
|
|
477
|
-
comment.nodeDescription = describeNodeForDebugging(node);
|
|
478
|
-
}
|
|
479
|
-
function addLeadingComment(node, comment) {
|
|
480
|
-
comment.leading = true;
|
|
481
|
-
comment.trailing = false;
|
|
482
|
-
addCommentHelper(node, comment);
|
|
483
|
-
}
|
|
484
|
-
function addDanglingComment(node, comment, marker) {
|
|
485
|
-
comment.leading = false;
|
|
486
|
-
comment.trailing = false;
|
|
487
|
-
if (marker) {
|
|
488
|
-
comment.marker = marker;
|
|
489
|
-
}
|
|
490
|
-
addCommentHelper(node, comment);
|
|
491
|
-
}
|
|
492
|
-
function addTrailingComment(node, comment) {
|
|
493
|
-
comment.leading = false;
|
|
494
|
-
comment.trailing = true;
|
|
495
|
-
addCommentHelper(node, comment);
|
|
496
|
-
}
|
|
497
|
-
var init_utils = __esm({
|
|
498
|
-
"src/main/comments/utils.js"() {
|
|
499
|
-
}
|
|
500
|
-
});
|
|
501
|
-
|
|
502
502
|
// src/utils/public.js
|
|
503
503
|
var public_exports = {};
|
|
504
504
|
__export(public_exports, {
|
|
@@ -563,29 +563,29 @@ function isNextLineEmpty2(text, startIndex) {
|
|
|
563
563
|
var init_public = __esm({
|
|
564
564
|
"src/utils/public.js"() {
|
|
565
565
|
init_get_next_non_space_non_comment_character_index();
|
|
566
|
-
init_is_previous_line_empty();
|
|
567
566
|
init_is_next_line_empty();
|
|
568
|
-
|
|
569
|
-
|
|
567
|
+
init_is_previous_line_empty();
|
|
568
|
+
init_utils();
|
|
570
569
|
init_get_alignment_size();
|
|
571
570
|
init_get_indent_size();
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
571
|
+
init_get_max_continuous_count();
|
|
572
|
+
init_get_next_non_space_non_comment_character();
|
|
573
|
+
init_get_string_width();
|
|
575
574
|
init_has_newline();
|
|
576
575
|
init_has_newline_in_range();
|
|
577
576
|
init_has_spaces();
|
|
578
|
-
init_get_next_non_space_non_comment_character();
|
|
579
577
|
init_make_string();
|
|
580
578
|
init_skip();
|
|
581
|
-
|
|
579
|
+
init_skip_inline_comment();
|
|
580
|
+
init_skip_newline();
|
|
581
|
+
init_skip_trailing_comment();
|
|
582
582
|
}
|
|
583
583
|
});
|
|
584
584
|
|
|
585
585
|
// src/main/version.evaluate.cjs
|
|
586
586
|
var require_version_evaluate = __commonJS({
|
|
587
587
|
"src/main/version.evaluate.cjs"(exports2, module2) {
|
|
588
|
-
module2.exports = "4.0.0-alpha.
|
|
588
|
+
module2.exports = "4.0.0-alpha.8";
|
|
589
589
|
}
|
|
590
590
|
});
|
|
591
591
|
|