prettier-plugin-embed 0.4.15 → 0.5.0
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/README.md +1 -0
- package/dist/embedded/register.d.ts +14 -14
- package/dist/index.js +669 -663
- package/dist/options.d.ts +3 -9
- package/dist/parsers.d.ts +20 -20
- package/dist/utils.d.ts +23 -20
- package/package.json +60 -68
package/dist/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { builders as M, utils as si } from "prettier/doc";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { printers as
|
|
8
|
-
import { resolveConfigFile as
|
|
9
|
-
const { group:
|
|
10
|
-
function
|
|
2
|
+
import fi from "prettier/parser-babel";
|
|
3
|
+
import yi from "prettier/parser-espree";
|
|
4
|
+
import _i from "prettier/parser-flow";
|
|
5
|
+
import $i from "prettier/parser-meriyah";
|
|
6
|
+
import vi from "prettier/parser-typescript";
|
|
7
|
+
import { printers as Di } from "prettier/plugins/estree.mjs";
|
|
8
|
+
import { resolveConfigFile as Ti } from "prettier";
|
|
9
|
+
const { group: Mi, indent: Ai, softline: Be, hardline: Si, lineSuffixBoundary: ki } = M, { mapDoc: Li } = si;
|
|
10
|
+
function Gi(e, t) {
|
|
11
11
|
const { node: n } = e;
|
|
12
12
|
let r = t();
|
|
13
|
-
return n?.comments?.length && (r =
|
|
13
|
+
return n?.comments?.length && (r = Mi([Ai([Be, r]), Be])), ["${", r, ki, "}"];
|
|
14
14
|
}
|
|
15
15
|
function k(e, t) {
|
|
16
16
|
return e.map(
|
|
17
|
-
(n) =>
|
|
17
|
+
(n) => Gi(n, t),
|
|
18
18
|
"expressions"
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
function S(e, t, n, r = !1) {
|
|
22
|
-
return
|
|
23
|
-
if (typeof
|
|
24
|
-
return
|
|
25
|
-
const
|
|
22
|
+
return Li(e, (o) => {
|
|
23
|
+
if (typeof o != "string")
|
|
24
|
+
return o;
|
|
25
|
+
const i = [], l = o.split(t);
|
|
26
26
|
for (let u = 0; u < l.length; u++) {
|
|
27
27
|
let E = l[u];
|
|
28
28
|
if (u % 2 === 0) {
|
|
@@ -31,30 +31,30 @@ function S(e, t, n, r = !1) {
|
|
|
31
31
|
if (E = E.replaceAll(/([\\`]|\${)/g, "\\$1"), r)
|
|
32
32
|
for (const d of E.split(/(\n)/))
|
|
33
33
|
d === `
|
|
34
|
-
` ?
|
|
34
|
+
` ? i.push(Si) : i.push(d);
|
|
35
35
|
else
|
|
36
|
-
|
|
36
|
+
i.push(E);
|
|
37
37
|
} else {
|
|
38
38
|
const d = Number(E);
|
|
39
|
-
|
|
39
|
+
i.push(n[d]);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
return
|
|
42
|
+
return i;
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Ni(e, t, n) {
|
|
46
46
|
if (t === n) {
|
|
47
47
|
e.unshift(t);
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
let r = 0,
|
|
51
|
-
for (; r <
|
|
52
|
-
const
|
|
53
|
-
if (e[
|
|
50
|
+
let r = 0, s = e.length;
|
|
51
|
+
for (; r < s; ) {
|
|
52
|
+
const o = r + s >>> 1;
|
|
53
|
+
if (e[o] === n) {
|
|
54
54
|
e.push(t);
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
e[
|
|
57
|
+
e[o] < t ? r = o + 1 : s = o;
|
|
58
58
|
}
|
|
59
59
|
e.splice(r, 0, t);
|
|
60
60
|
}
|
|
@@ -63,17 +63,17 @@ const he = (() => {
|
|
|
63
63
|
return () => {
|
|
64
64
|
let n = "";
|
|
65
65
|
for (let r = 0; r < 16; ++r)
|
|
66
|
-
n += e[parseInt((Math.random() * e.length).toFixed(0), 10) % e.length];
|
|
66
|
+
n += e[Number.parseInt((Math.random() * e.length).toFixed(0), 10) % e.length];
|
|
67
67
|
return n;
|
|
68
68
|
};
|
|
69
69
|
})();
|
|
70
70
|
function L(e = "p", t = "") {
|
|
71
|
-
const n = he(), r = he(),
|
|
72
|
-
`${
|
|
71
|
+
const n = he(), r = he(), s = qe(e), o = qe(t), i = (u) => `${e}${n}${u}${r}${t}`, l = new RegExp(
|
|
72
|
+
`${s}${n}(\\d+)${r}${o}`,
|
|
73
73
|
"ig"
|
|
74
74
|
);
|
|
75
75
|
return {
|
|
76
|
-
createPlaceholder:
|
|
76
|
+
createPlaceholder: i,
|
|
77
77
|
placeholderRegex: l
|
|
78
78
|
};
|
|
79
79
|
}
|
|
@@ -89,16 +89,16 @@ function A(e) {
|
|
|
89
89
|
function T(e) {
|
|
90
90
|
return `${e}Tags`;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Oi(e) {
|
|
93
93
|
return `${e}Plugin`;
|
|
94
94
|
}
|
|
95
95
|
function O(e) {
|
|
96
96
|
return `${e}Parser`;
|
|
97
97
|
}
|
|
98
|
-
const _ = "9ff2b366e8ca4c97b9aed1a29b5b94ed", { line: je, group: I, indent: Ue, softline: Re } = M,
|
|
99
|
-
const
|
|
98
|
+
const _ = "9ff2b366e8ca4c97b9aed1a29b5b94ed", { line: je, group: I, indent: Ue, softline: Re } = M, xi = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
99
|
+
const i = {
|
|
100
100
|
...r,
|
|
101
|
-
...
|
|
101
|
+
...o
|
|
102
102
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(
|
|
103
103
|
"@prettier-placeholder"
|
|
104
104
|
), d = l.quasis.map(
|
|
@@ -107,36 +107,36 @@ const _ = "9ff2b366e8ca4c97b9aed1a29b5b94ed", { line: je, group: I, indent: Ue,
|
|
|
107
107
|
c.length,
|
|
108
108
|
-p.length || void 0
|
|
109
109
|
), b = k(n, t), $ = await e(f, {
|
|
110
|
-
...
|
|
111
|
-
parser:
|
|
112
|
-
}),
|
|
110
|
+
...i,
|
|
111
|
+
parser: i.embeddedCssParser ?? "scss"
|
|
112
|
+
}), a = S(
|
|
113
113
|
$,
|
|
114
114
|
E,
|
|
115
115
|
b,
|
|
116
116
|
// https://github.com/prettier/prettier/blob/3bfabd012873e5022f341aca75566966d91870f1/src/language-js/embed/css.js#L52
|
|
117
117
|
!0
|
|
118
118
|
);
|
|
119
|
-
if (
|
|
119
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
120
120
|
return I([
|
|
121
121
|
"`",
|
|
122
122
|
c,
|
|
123
|
-
|
|
123
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [I(a)] : Ue([I(a)]),
|
|
124
124
|
p,
|
|
125
125
|
"`"
|
|
126
126
|
]);
|
|
127
127
|
const h = c.length ? je : Re, v = p.length ? je : Re;
|
|
128
128
|
return I([
|
|
129
129
|
"`",
|
|
130
|
-
|
|
130
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, I(a)] : Ue([h, I(a)]),
|
|
131
131
|
v,
|
|
132
132
|
"`"
|
|
133
133
|
]);
|
|
134
|
-
}, re = "embeddedCss",
|
|
135
|
-
[
|
|
134
|
+
}, re = "embeddedCss", Ii = ["css"], Pi = ["css", "less", "scss"], Bi = D(re), Ce = A(re), we = T(re), qi = O(re), ji = {
|
|
135
|
+
[Bi]: {
|
|
136
136
|
category: "Embed",
|
|
137
137
|
type: "string",
|
|
138
138
|
array: !0,
|
|
139
|
-
default: [{ value: [...
|
|
139
|
+
default: [{ value: [...Ii] }],
|
|
140
140
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded CSS language.",
|
|
141
141
|
deprecated: `Please use \`${Ce}\` or \`${we}\`.`
|
|
142
142
|
},
|
|
@@ -154,50 +154,50 @@ const _ = "9ff2b366e8ca4c97b9aed1a29b5b94ed", { line: je, group: I, indent: Ue,
|
|
|
154
154
|
default: [{ value: [_] }],
|
|
155
155
|
description: "Tags that make their subsequent template literals be identified as embedded CSS language."
|
|
156
156
|
},
|
|
157
|
-
[
|
|
157
|
+
[qi]: {
|
|
158
158
|
category: "Embed",
|
|
159
159
|
type: "choice",
|
|
160
160
|
default: "scss",
|
|
161
161
|
description: "The parser used to parse the embedded CSS language.",
|
|
162
|
-
choices:
|
|
162
|
+
choices: Pi.map((e) => ({
|
|
163
163
|
value: e,
|
|
164
164
|
description: `Use the "${e}" parser.`
|
|
165
165
|
}))
|
|
166
166
|
}
|
|
167
|
-
},
|
|
167
|
+
}, Ui = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
168
168
|
__proto__: null,
|
|
169
|
-
embedder:
|
|
169
|
+
embedder: xi,
|
|
170
170
|
language: re,
|
|
171
|
-
options:
|
|
172
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Fe, group: P, indent: We, softline: ze } = M,
|
|
173
|
-
const
|
|
171
|
+
options: ji
|
|
172
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Fe, group: P, indent: We, softline: ze } = M, Ri = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
173
|
+
const i = {
|
|
174
174
|
...r,
|
|
175
|
-
...
|
|
175
|
+
...o
|
|
176
176
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
177
177
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
178
178
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
179
179
|
c.length,
|
|
180
180
|
-p.length || void 0
|
|
181
181
|
), b = k(n, t), $ = await e(f, {
|
|
182
|
-
...
|
|
183
|
-
parser:
|
|
184
|
-
}),
|
|
185
|
-
if (
|
|
182
|
+
...i,
|
|
183
|
+
parser: i.embeddedEsParser ?? "babel"
|
|
184
|
+
}), a = S($, E, b);
|
|
185
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
186
186
|
return P([
|
|
187
187
|
"`",
|
|
188
188
|
c,
|
|
189
|
-
|
|
189
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [P(a)] : We([P(a)]),
|
|
190
190
|
p,
|
|
191
191
|
"`"
|
|
192
192
|
]);
|
|
193
193
|
const h = c.length ? Fe : ze, v = p.length ? Fe : ze;
|
|
194
194
|
return P([
|
|
195
195
|
"`",
|
|
196
|
-
|
|
196
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, P(a)] : We([h, P(a)]),
|
|
197
197
|
v,
|
|
198
198
|
"`"
|
|
199
199
|
]);
|
|
200
|
-
}, oe = "embeddedEs",
|
|
200
|
+
}, oe = "embeddedEs", Ci = [
|
|
201
201
|
"js",
|
|
202
202
|
"jsx",
|
|
203
203
|
"es",
|
|
@@ -206,19 +206,19 @@ const _ = "9ff2b366e8ca4c97b9aed1a29b5b94ed", { line: je, group: I, indent: Ue,
|
|
|
206
206
|
"cjs",
|
|
207
207
|
"pac",
|
|
208
208
|
"javascript"
|
|
209
|
-
],
|
|
209
|
+
], wi = [
|
|
210
210
|
"babel",
|
|
211
211
|
"babel-flow",
|
|
212
212
|
"acorn",
|
|
213
213
|
"espree",
|
|
214
214
|
"flow",
|
|
215
215
|
"meriyah"
|
|
216
|
-
],
|
|
217
|
-
[
|
|
216
|
+
], Fi = D(oe), Ke = A(oe), Je = T(oe), Wi = O(oe), zi = {
|
|
217
|
+
[Fi]: {
|
|
218
218
|
category: "Embed",
|
|
219
219
|
type: "string",
|
|
220
220
|
array: !0,
|
|
221
|
-
default: [{ value: [...
|
|
221
|
+
default: [{ value: [...Ci] }],
|
|
222
222
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language.",
|
|
223
223
|
deprecated: `Please use \`${Ke}\` or \`${Je}\`.`
|
|
224
224
|
},
|
|
@@ -236,55 +236,55 @@ const _ = "9ff2b366e8ca4c97b9aed1a29b5b94ed", { line: je, group: I, indent: Ue,
|
|
|
236
236
|
default: [{ value: [_] }],
|
|
237
237
|
description: "Tags that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language."
|
|
238
238
|
},
|
|
239
|
-
[
|
|
239
|
+
[Wi]: {
|
|
240
240
|
category: "Embed",
|
|
241
241
|
type: "choice",
|
|
242
242
|
default: "babel",
|
|
243
243
|
description: "The parser used to parse the embedded ECMASCript/JavaScript language.",
|
|
244
|
-
choices:
|
|
244
|
+
choices: wi.map((e) => ({
|
|
245
245
|
value: e,
|
|
246
246
|
description: `Use the "${e}" parser.`
|
|
247
247
|
}))
|
|
248
248
|
}
|
|
249
|
-
},
|
|
249
|
+
}, Ki = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
250
250
|
__proto__: null,
|
|
251
|
-
embedder:
|
|
251
|
+
embedder: Ri,
|
|
252
252
|
language: oe,
|
|
253
|
-
options:
|
|
254
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: He, group: B, indent: Xe, softline: Qe } = M,
|
|
255
|
-
const
|
|
253
|
+
options: zi
|
|
254
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: He, group: B, indent: Xe, softline: Qe } = M, Ji = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
255
|
+
const i = {
|
|
256
256
|
...r,
|
|
257
|
-
...
|
|
257
|
+
...o
|
|
258
258
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
259
259
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
260
260
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
261
261
|
c.length,
|
|
262
262
|
-p.length || void 0
|
|
263
263
|
), b = k(n, t), $ = await e(f, {
|
|
264
|
-
...
|
|
264
|
+
...i,
|
|
265
265
|
parser: "glsl-parser"
|
|
266
|
-
}),
|
|
267
|
-
if (
|
|
266
|
+
}), a = S($, E, b);
|
|
267
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
268
268
|
return B([
|
|
269
269
|
"`",
|
|
270
270
|
c,
|
|
271
|
-
|
|
271
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [B(a)] : Xe([B(a)]),
|
|
272
272
|
p,
|
|
273
273
|
"`"
|
|
274
274
|
]);
|
|
275
275
|
const h = c.length ? He : Qe, v = p.length ? He : Qe;
|
|
276
276
|
return B([
|
|
277
277
|
"`",
|
|
278
|
-
|
|
278
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, B(a)] : Xe([h, B(a)]),
|
|
279
279
|
v,
|
|
280
280
|
"`"
|
|
281
281
|
]);
|
|
282
|
-
}, be = "embeddedGlsl",
|
|
283
|
-
[
|
|
282
|
+
}, be = "embeddedGlsl", Hi = ["glsl", "shader"], Xi = D(be), Ye = A(be), Ve = T(be), Qi = {
|
|
283
|
+
[Xi]: {
|
|
284
284
|
category: "Embed",
|
|
285
285
|
type: "string",
|
|
286
286
|
array: !0,
|
|
287
|
-
default: [{ value: [...
|
|
287
|
+
default: [{ value: [...Hi] }],
|
|
288
288
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded GLSL language. This option requires the `prettier-plugin-glsl` plugin.",
|
|
289
289
|
deprecated: `Please use \`${Ye}\` or \`${Ve}\`.`
|
|
290
290
|
},
|
|
@@ -302,45 +302,45 @@ const _ = "9ff2b366e8ca4c97b9aed1a29b5b94ed", { line: je, group: I, indent: Ue,
|
|
|
302
302
|
default: [{ value: [_] }],
|
|
303
303
|
description: "Tags that make their subsequent template literals be identified as embedded GLSL language. This option requires the `prettier-plugin-glsl` plugin."
|
|
304
304
|
}
|
|
305
|
-
},
|
|
305
|
+
}, Yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
306
306
|
__proto__: null,
|
|
307
|
-
embedder:
|
|
307
|
+
embedder: Ji,
|
|
308
308
|
language: be,
|
|
309
|
-
options:
|
|
310
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Ze, group: q, indent: et, softline: tt } = M,
|
|
311
|
-
const
|
|
309
|
+
options: Qi
|
|
310
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Ze, group: q, indent: et, softline: tt } = M, Vi = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
311
|
+
const i = {
|
|
312
312
|
...r,
|
|
313
|
-
...
|
|
313
|
+
...o
|
|
314
314
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
315
315
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
316
316
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
317
317
|
c.length,
|
|
318
318
|
-p.length || void 0
|
|
319
319
|
), b = k(n, t), $ = await e(f, {
|
|
320
|
-
...
|
|
320
|
+
...i,
|
|
321
321
|
parser: "graphql"
|
|
322
|
-
}),
|
|
323
|
-
if (
|
|
322
|
+
}), a = S($, E, b);
|
|
323
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
324
324
|
return q([
|
|
325
325
|
"`",
|
|
326
326
|
c,
|
|
327
|
-
|
|
327
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [q(a)] : et([q(a)]),
|
|
328
328
|
p,
|
|
329
329
|
"`"
|
|
330
330
|
]);
|
|
331
331
|
const h = c.length ? Ze : tt, v = p.length ? Ze : tt;
|
|
332
332
|
return q([
|
|
333
333
|
"`",
|
|
334
|
-
|
|
334
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, q(a)] : et([h, q(a)]),
|
|
335
335
|
v,
|
|
336
336
|
"`"
|
|
337
337
|
]);
|
|
338
|
-
}, fe = "embeddedGraphql",
|
|
339
|
-
[
|
|
338
|
+
}, fe = "embeddedGraphql", Zi = ["graphql", "gql"], es = D(fe), nt = A(fe), it = T(fe), ts = {
|
|
339
|
+
[es]: {
|
|
340
340
|
category: "Embed",
|
|
341
341
|
type: "string",
|
|
342
342
|
array: !0,
|
|
343
|
-
default: [{ value: [...
|
|
343
|
+
default: [{ value: [...Zi] }],
|
|
344
344
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded GraphQL language.",
|
|
345
345
|
deprecated: `Please use \`${nt}\` or \`${it}\`.`
|
|
346
346
|
},
|
|
@@ -358,24 +358,24 @@ const _ = "9ff2b366e8ca4c97b9aed1a29b5b94ed", { line: je, group: I, indent: Ue,
|
|
|
358
358
|
default: [{ value: [_] }],
|
|
359
359
|
description: "Tags that make their subsequent template literals be identified as embedded GraphQL language."
|
|
360
360
|
}
|
|
361
|
-
},
|
|
361
|
+
}, ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
362
362
|
__proto__: null,
|
|
363
|
-
embedder:
|
|
363
|
+
embedder: Vi,
|
|
364
364
|
language: fe,
|
|
365
|
-
options:
|
|
366
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: st, group: j, indent: rt, softline: ot } = M, { mapDoc:
|
|
367
|
-
const
|
|
365
|
+
options: ts
|
|
366
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: st, group: j, indent: rt, softline: ot } = M, { mapDoc: is } = si, ss = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
367
|
+
const i = {
|
|
368
368
|
...r,
|
|
369
|
-
...
|
|
369
|
+
...o
|
|
370
370
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
371
371
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
372
372
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
373
373
|
c.length,
|
|
374
374
|
-p.length || void 0
|
|
375
375
|
), b = k(n, t), $ = await e(f, {
|
|
376
|
-
...
|
|
377
|
-
parser:
|
|
378
|
-
}),
|
|
376
|
+
...i,
|
|
377
|
+
parser: i.embeddedHtmlParser ?? "html"
|
|
378
|
+
}), a = is($, (m) => {
|
|
379
379
|
if (typeof m != "string")
|
|
380
380
|
return m;
|
|
381
381
|
const g = [], y = m.split(E);
|
|
@@ -384,7 +384,7 @@ const _ = "9ff2b366e8ca4c97b9aed1a29b5b94ed", { line: je, group: I, indent: Ue,
|
|
|
384
384
|
if (G % 2 === 0) {
|
|
385
385
|
if (!N)
|
|
386
386
|
continue;
|
|
387
|
-
N = N.replaceAll(/([\\`]|\${)/g, "\\$1"),
|
|
387
|
+
N = N.replaceAll(/([\\`]|\${)/g, "\\$1"), i.__embeddedInHtml && (N = N.replaceAll(/<\/(?=script\b)/gi, "<\\/")), g.push(N);
|
|
388
388
|
} else {
|
|
389
389
|
const x = Number(N);
|
|
390
390
|
g.push(b[x]);
|
|
@@ -392,28 +392,28 @@ const _ = "9ff2b366e8ca4c97b9aed1a29b5b94ed", { line: je, group: I, indent: Ue,
|
|
|
392
392
|
}
|
|
393
393
|
return g;
|
|
394
394
|
});
|
|
395
|
-
if (
|
|
396
|
-
|
|
395
|
+
if (i.htmlWhitespaceSensitivity === "strict" || // TODO: is css mode should be included here?
|
|
396
|
+
i.htmlWhitespaceSensitivity === "css" || i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
397
397
|
return j([
|
|
398
398
|
"`",
|
|
399
399
|
c,
|
|
400
|
-
|
|
400
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [j(a)] : rt([j(a)]),
|
|
401
401
|
p,
|
|
402
402
|
"`"
|
|
403
403
|
]);
|
|
404
404
|
const h = c.length ? st : ot, v = p.length ? st : ot;
|
|
405
405
|
return j([
|
|
406
406
|
"`",
|
|
407
|
-
|
|
407
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, j(a)] : rt([h, j(a)]),
|
|
408
408
|
v,
|
|
409
409
|
"`"
|
|
410
410
|
]);
|
|
411
|
-
}, ae = "embeddedHtml",
|
|
412
|
-
[
|
|
411
|
+
}, ae = "embeddedHtml", rs = ["html", "xhtml"], os = ["html", "vue", "angular", "lwc"], as = D(ae), at = A(ae), dt = T(ae), ds = O(ae), ls = {
|
|
412
|
+
[as]: {
|
|
413
413
|
category: "Embed",
|
|
414
414
|
type: "string",
|
|
415
415
|
array: !0,
|
|
416
|
-
default: [{ value: [...
|
|
416
|
+
default: [{ value: [...rs] }],
|
|
417
417
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded HTML language.",
|
|
418
418
|
deprecated: `Please use \`${at}\` or \`${dt}\`.`
|
|
419
419
|
},
|
|
@@ -431,55 +431,55 @@ const _ = "9ff2b366e8ca4c97b9aed1a29b5b94ed", { line: je, group: I, indent: Ue,
|
|
|
431
431
|
default: [{ value: [_] }],
|
|
432
432
|
description: "Tags that make their subsequent template literals be identified as embedded HTML language."
|
|
433
433
|
},
|
|
434
|
-
[
|
|
434
|
+
[ds]: {
|
|
435
435
|
category: "Embed",
|
|
436
436
|
type: "choice",
|
|
437
437
|
default: "html",
|
|
438
438
|
description: "The parser used to parse the embedded HTML language.",
|
|
439
|
-
choices:
|
|
439
|
+
choices: os.map((e) => ({
|
|
440
440
|
value: e,
|
|
441
441
|
description: `Use the "${e}" parser.`
|
|
442
442
|
}))
|
|
443
443
|
}
|
|
444
|
-
},
|
|
444
|
+
}, cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
445
445
|
__proto__: null,
|
|
446
|
-
embedder:
|
|
446
|
+
embedder: ss,
|
|
447
447
|
language: ae,
|
|
448
|
-
options:
|
|
449
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: lt, group: U, indent: ct, softline: ut } = M,
|
|
450
|
-
const
|
|
448
|
+
options: ls
|
|
449
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: lt, group: U, indent: ct, softline: ut } = M, us = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
450
|
+
const i = {
|
|
451
451
|
...r,
|
|
452
|
-
...
|
|
452
|
+
...o
|
|
453
453
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
454
454
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
455
455
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
456
456
|
c.length,
|
|
457
457
|
-p.length || void 0
|
|
458
458
|
), b = k(n, t), $ = await e(f, {
|
|
459
|
-
...
|
|
459
|
+
...i,
|
|
460
460
|
parser: "ini"
|
|
461
|
-
}),
|
|
462
|
-
if (
|
|
461
|
+
}), a = S($, E, b);
|
|
462
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
463
463
|
return U([
|
|
464
464
|
"`",
|
|
465
465
|
c,
|
|
466
|
-
|
|
466
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [U(a)] : ct([U(a)]),
|
|
467
467
|
p,
|
|
468
468
|
"`"
|
|
469
469
|
]);
|
|
470
470
|
const h = c.length ? lt : ut, v = p.length ? lt : ut;
|
|
471
471
|
return U([
|
|
472
472
|
"`",
|
|
473
|
-
|
|
473
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, U(a)] : ct([h, U(a)]),
|
|
474
474
|
v,
|
|
475
475
|
"`"
|
|
476
476
|
]);
|
|
477
|
-
}, ye = "embeddedIni",
|
|
478
|
-
[
|
|
477
|
+
}, ye = "embeddedIni", ps = ["ini", "cfg", "pro"], gs = D(ye), pt = A(ye), gt = T(ye), ms = {
|
|
478
|
+
[gs]: {
|
|
479
479
|
category: "Embed",
|
|
480
480
|
type: "string",
|
|
481
481
|
array: !0,
|
|
482
|
-
default: [{ value: [...
|
|
482
|
+
default: [{ value: [...ps] }],
|
|
483
483
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin.",
|
|
484
484
|
deprecated: `Please use \`${pt}\` or \`${gt}\`.`
|
|
485
485
|
},
|
|
@@ -497,50 +497,50 @@ const _ = "9ff2b366e8ca4c97b9aed1a29b5b94ed", { line: je, group: I, indent: Ue,
|
|
|
497
497
|
default: [{ value: [_] }],
|
|
498
498
|
description: "Tags that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin."
|
|
499
499
|
}
|
|
500
|
-
},
|
|
500
|
+
}, hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
501
501
|
__proto__: null,
|
|
502
|
-
embedder:
|
|
502
|
+
embedder: us,
|
|
503
503
|
language: ye,
|
|
504
|
-
options:
|
|
505
|
-
}, Symbol.toStringTag, { value: "Module" })), { group: R, line: mt, softline: ht, indent: Et } = M,
|
|
506
|
-
const
|
|
504
|
+
options: ms
|
|
505
|
+
}, Symbol.toStringTag, { value: "Module" })), { group: R, line: mt, softline: ht, indent: Et } = M, Es = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
506
|
+
const i = {
|
|
507
507
|
...r,
|
|
508
|
-
...
|
|
508
|
+
...o
|
|
509
509
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
510
510
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
511
511
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
512
512
|
c.length,
|
|
513
513
|
-p.length || void 0
|
|
514
514
|
), b = k(n, t), $ = await e(f, {
|
|
515
|
-
...
|
|
515
|
+
...i,
|
|
516
516
|
parser: "java"
|
|
517
|
-
}),
|
|
517
|
+
}), a = S(
|
|
518
518
|
$,
|
|
519
519
|
E,
|
|
520
520
|
b,
|
|
521
521
|
!0
|
|
522
522
|
);
|
|
523
|
-
if (
|
|
523
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
524
524
|
return R([
|
|
525
525
|
"`",
|
|
526
526
|
c,
|
|
527
|
-
|
|
527
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [R(a)] : Et([R(a)]),
|
|
528
528
|
p,
|
|
529
529
|
"`"
|
|
530
530
|
]);
|
|
531
531
|
const h = c.length ? mt : ht, v = p.length ? mt : ht;
|
|
532
532
|
return R([
|
|
533
533
|
"`",
|
|
534
|
-
|
|
534
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, R(a)] : Et([h, R(a)]),
|
|
535
535
|
v,
|
|
536
536
|
"`"
|
|
537
537
|
]);
|
|
538
|
-
}, _e = "embeddedJava",
|
|
539
|
-
[
|
|
538
|
+
}, _e = "embeddedJava", bs = ["java"], fs = D(_e), bt = A(_e), ft = T(_e), ys = {
|
|
539
|
+
[fs]: {
|
|
540
540
|
category: "Embed",
|
|
541
541
|
type: "string",
|
|
542
542
|
array: !0,
|
|
543
|
-
default: [{ value: [...
|
|
543
|
+
default: [{ value: [...bs] }],
|
|
544
544
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin.",
|
|
545
545
|
deprecated: `Please use \`${bt}\` or \`${ft}\`.`
|
|
546
546
|
},
|
|
@@ -558,42 +558,42 @@ const _ = "9ff2b366e8ca4c97b9aed1a29b5b94ed", { line: je, group: I, indent: Ue,
|
|
|
558
558
|
default: [{ value: [_] }],
|
|
559
559
|
description: "Tags that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin."
|
|
560
560
|
}
|
|
561
|
-
},
|
|
561
|
+
}, _s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
562
562
|
__proto__: null,
|
|
563
|
-
embedder:
|
|
563
|
+
embedder: Es,
|
|
564
564
|
language: _e,
|
|
565
|
-
options:
|
|
566
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: yt, group: C, indent: _t, softline: $t } = M,
|
|
567
|
-
const
|
|
565
|
+
options: ys
|
|
566
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: yt, group: C, indent: _t, softline: $t } = M, $s = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
567
|
+
const i = {
|
|
568
568
|
...r,
|
|
569
|
-
...
|
|
570
|
-
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } =
|
|
569
|
+
...o
|
|
570
|
+
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = vs(), d = l.quasis.map(
|
|
571
571
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
572
572
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
573
573
|
c.length,
|
|
574
574
|
-p.length || void 0
|
|
575
575
|
), b = k(n, t), $ = await e(f, {
|
|
576
|
-
...
|
|
577
|
-
parser:
|
|
578
|
-
}),
|
|
579
|
-
if (
|
|
576
|
+
...i,
|
|
577
|
+
parser: i.embeddedJsonParser ?? "json"
|
|
578
|
+
}), a = S($, E, b);
|
|
579
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
580
580
|
return C([
|
|
581
581
|
"`",
|
|
582
582
|
c,
|
|
583
|
-
|
|
583
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [C(a)] : _t([C(a)]),
|
|
584
584
|
p,
|
|
585
585
|
"`"
|
|
586
586
|
]);
|
|
587
587
|
const h = c.length ? yt : $t, v = p.length ? yt : $t;
|
|
588
588
|
return C([
|
|
589
589
|
"`",
|
|
590
|
-
|
|
590
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, C(a)] : _t([h, C(a)]),
|
|
591
591
|
v,
|
|
592
592
|
"`"
|
|
593
593
|
]);
|
|
594
594
|
};
|
|
595
|
-
function
|
|
596
|
-
const e = he(), t = he(), n = (
|
|
595
|
+
function vs() {
|
|
596
|
+
const e = he(), t = he(), n = (s) => `'0${e}${s}${t}'`, r = new RegExp(
|
|
597
597
|
`["']?0${e}(\\d+)${t}['"]?`,
|
|
598
598
|
"ig"
|
|
599
599
|
);
|
|
@@ -602,12 +602,12 @@ function $s() {
|
|
|
602
602
|
placeholderRegex: r
|
|
603
603
|
};
|
|
604
604
|
}
|
|
605
|
-
const de = "embeddedJson",
|
|
606
|
-
[
|
|
605
|
+
const de = "embeddedJson", Ds = ["json", "jsonl"], Ts = ["json", "json5", "jsonc", "json-stringify"], Ms = D(de), vt = A(de), Dt = T(de), As = O(de), Ss = {
|
|
606
|
+
[Ms]: {
|
|
607
607
|
category: "Embed",
|
|
608
608
|
type: "string",
|
|
609
609
|
array: !0,
|
|
610
|
-
default: [{ value: [...
|
|
610
|
+
default: [{ value: [...Ds] }],
|
|
611
611
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded JSON language.",
|
|
612
612
|
deprecated: `Please use \`${vt}\` or \`${Dt}\`.`
|
|
613
613
|
},
|
|
@@ -625,55 +625,55 @@ const de = "embeddedJson", vs = ["json", "jsonl"], Ds = ["json", "json5", "jsonc
|
|
|
625
625
|
default: [{ value: [_] }],
|
|
626
626
|
description: "Tags that make their subsequent template literals be identified as embedded JSON language."
|
|
627
627
|
},
|
|
628
|
-
[
|
|
628
|
+
[As]: {
|
|
629
629
|
category: "Embed",
|
|
630
630
|
type: "choice",
|
|
631
631
|
default: "json",
|
|
632
632
|
description: "The parser used to parse the embedded JSON language.",
|
|
633
|
-
choices:
|
|
633
|
+
choices: Ts.map((e) => ({
|
|
634
634
|
value: e,
|
|
635
635
|
description: `Use the "${e}" parser.`
|
|
636
636
|
}))
|
|
637
637
|
}
|
|
638
|
-
},
|
|
638
|
+
}, ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
639
639
|
__proto__: null,
|
|
640
|
-
embedder:
|
|
640
|
+
embedder: $s,
|
|
641
641
|
language: de,
|
|
642
|
-
options:
|
|
643
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Tt, group: w, indent: Mt, softline: At } = M,
|
|
644
|
-
const
|
|
642
|
+
options: Ss
|
|
643
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Tt, group: w, indent: Mt, softline: At } = M, Ls = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
644
|
+
const i = {
|
|
645
645
|
...r,
|
|
646
|
-
...
|
|
646
|
+
...o
|
|
647
647
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L("$p"), d = l.quasis.map(
|
|
648
648
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
649
649
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
650
650
|
c.length,
|
|
651
651
|
-p.length || void 0
|
|
652
652
|
), b = k(n, t), $ = await e(f, {
|
|
653
|
-
...
|
|
653
|
+
...i,
|
|
654
654
|
parser: "JSONata"
|
|
655
|
-
}),
|
|
656
|
-
if (
|
|
655
|
+
}), a = S($, E, b);
|
|
656
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
657
657
|
return w([
|
|
658
658
|
"`",
|
|
659
659
|
c,
|
|
660
|
-
|
|
660
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [w(a)] : Mt([w(a)]),
|
|
661
661
|
p,
|
|
662
662
|
"`"
|
|
663
663
|
]);
|
|
664
664
|
const h = c.length ? Tt : At, v = p.length ? Tt : At;
|
|
665
665
|
return w([
|
|
666
666
|
"`",
|
|
667
|
-
|
|
667
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, w(a)] : Mt([h, w(a)]),
|
|
668
668
|
v,
|
|
669
669
|
"`"
|
|
670
670
|
]);
|
|
671
|
-
}, $e = "embeddedJsonata",
|
|
672
|
-
[
|
|
671
|
+
}, $e = "embeddedJsonata", Gs = ["jsonata"], Ns = D($e), St = A($e), kt = T($e), Os = {
|
|
672
|
+
[Ns]: {
|
|
673
673
|
category: "Embed",
|
|
674
674
|
type: "string",
|
|
675
675
|
array: !0,
|
|
676
|
-
default: [{ value: [...
|
|
676
|
+
default: [{ value: [...Gs] }],
|
|
677
677
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin.",
|
|
678
678
|
deprecated: `Please use \`${St}\` or \`${kt}\`.`
|
|
679
679
|
},
|
|
@@ -691,40 +691,40 @@ const de = "embeddedJson", vs = ["json", "jsonl"], Ds = ["json", "json5", "jsonc
|
|
|
691
691
|
default: [{ value: [_] }],
|
|
692
692
|
description: "Tags that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin."
|
|
693
693
|
}
|
|
694
|
-
},
|
|
694
|
+
}, xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
695
695
|
__proto__: null,
|
|
696
|
-
embedder:
|
|
696
|
+
embedder: Ls,
|
|
697
697
|
language: $e,
|
|
698
|
-
options:
|
|
699
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Lt, group: F, indent: Gt, softline: Nt } = M,
|
|
700
|
-
const
|
|
698
|
+
options: Os
|
|
699
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Lt, group: F, indent: Gt, softline: Nt } = M, Is = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
700
|
+
const i = {
|
|
701
701
|
...r,
|
|
702
|
-
...
|
|
702
|
+
...o
|
|
703
703
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
704
704
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
705
705
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
706
706
|
c.length,
|
|
707
707
|
-p.length || void 0
|
|
708
708
|
), b = k(n, t), $ = await e(f, {
|
|
709
|
-
...
|
|
709
|
+
...i,
|
|
710
710
|
parser: "latex-parser"
|
|
711
|
-
}),
|
|
712
|
-
if (
|
|
711
|
+
}), a = S($, E, b);
|
|
712
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
713
713
|
return F([
|
|
714
714
|
"`",
|
|
715
715
|
c,
|
|
716
|
-
|
|
716
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [F(a)] : Gt([F(a)]),
|
|
717
717
|
p,
|
|
718
718
|
"`"
|
|
719
719
|
]);
|
|
720
720
|
const h = c.length ? Lt : Nt, v = p.length ? Lt : Nt;
|
|
721
721
|
return F([
|
|
722
722
|
"`",
|
|
723
|
-
|
|
723
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, F(a)] : Gt([h, F(a)]),
|
|
724
724
|
v,
|
|
725
725
|
"`"
|
|
726
726
|
]);
|
|
727
|
-
}, ve = "embeddedLatex",
|
|
727
|
+
}, ve = "embeddedLatex", Ps = [
|
|
728
728
|
"latex",
|
|
729
729
|
"tex",
|
|
730
730
|
"aux",
|
|
@@ -733,12 +733,12 @@ const de = "embeddedJson", vs = ["json", "jsonl"], Ds = ["json", "json5", "jsonc
|
|
|
733
733
|
"bib",
|
|
734
734
|
"toc",
|
|
735
735
|
"sty"
|
|
736
|
-
],
|
|
737
|
-
[
|
|
736
|
+
], Bs = D(ve), Ot = A(ve), xt = T(ve), qs = {
|
|
737
|
+
[Bs]: {
|
|
738
738
|
category: "Embed",
|
|
739
739
|
type: "string",
|
|
740
740
|
array: !0,
|
|
741
|
-
default: [{ value: [...
|
|
741
|
+
default: [{ value: [...Ps] }],
|
|
742
742
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin.",
|
|
743
743
|
deprecated: `Please use \`${Ot}\` or \`${xt}\`.`
|
|
744
744
|
},
|
|
@@ -756,18 +756,18 @@ const de = "embeddedJson", vs = ["json", "jsonl"], Ds = ["json", "json5", "jsonc
|
|
|
756
756
|
default: [{ value: [_] }],
|
|
757
757
|
description: "Tags that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin."
|
|
758
758
|
}
|
|
759
|
-
},
|
|
759
|
+
}, js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
760
760
|
__proto__: null,
|
|
761
|
-
embedder:
|
|
761
|
+
embedder: Is,
|
|
762
762
|
language: ve,
|
|
763
|
-
options:
|
|
763
|
+
options: qs
|
|
764
764
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
765
765
|
function It(e, t) {
|
|
766
766
|
var n = Object.keys(e);
|
|
767
767
|
if (Object.getOwnPropertySymbols) {
|
|
768
768
|
var r = Object.getOwnPropertySymbols(e);
|
|
769
|
-
t && (r = r.filter(function(
|
|
770
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
769
|
+
t && (r = r.filter(function(s) {
|
|
770
|
+
return Object.getOwnPropertyDescriptor(e, s).enumerable;
|
|
771
771
|
})), n.push.apply(n, r);
|
|
772
772
|
}
|
|
773
773
|
return n;
|
|
@@ -776,28 +776,26 @@ function Pt(e) {
|
|
|
776
776
|
for (var t = 1; t < arguments.length; t++) {
|
|
777
777
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
778
778
|
t % 2 ? It(Object(n), !0).forEach(function(r) {
|
|
779
|
-
|
|
779
|
+
Us(e, r, n[r]);
|
|
780
780
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : It(Object(n)).forEach(function(r) {
|
|
781
781
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
782
782
|
});
|
|
783
783
|
}
|
|
784
784
|
return e;
|
|
785
785
|
}
|
|
786
|
-
function
|
|
787
|
-
return t =
|
|
786
|
+
function Us(e, t, n) {
|
|
787
|
+
return t = Rs(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
|
|
788
788
|
}
|
|
789
|
-
function
|
|
790
|
-
var t =
|
|
789
|
+
function Rs(e) {
|
|
790
|
+
var t = Cs(e, "string");
|
|
791
791
|
return typeof t == "symbol" ? t : String(t);
|
|
792
792
|
}
|
|
793
|
-
function
|
|
794
|
-
if (typeof e != "object" || e === null)
|
|
795
|
-
return e;
|
|
793
|
+
function Cs(e, t) {
|
|
794
|
+
if (typeof e != "object" || e === null) return e;
|
|
796
795
|
var n = e[Symbol.toPrimitive];
|
|
797
796
|
if (n !== void 0) {
|
|
798
|
-
var r = n.call(e, t
|
|
799
|
-
if (typeof r != "object")
|
|
800
|
-
return r;
|
|
797
|
+
var r = n.call(e, t);
|
|
798
|
+
if (typeof r != "object") return r;
|
|
801
799
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
802
800
|
}
|
|
803
801
|
return (t === "string" ? String : Number)(e);
|
|
@@ -806,15 +804,15 @@ const ri = oi({});
|
|
|
806
804
|
function oi(e) {
|
|
807
805
|
return t.withOptions = (n) => oi(Pt(Pt({}, e), n)), t;
|
|
808
806
|
function t(n, ...r) {
|
|
809
|
-
const
|
|
810
|
-
escapeSpecialCharacters:
|
|
807
|
+
const s = typeof n == "string" ? [n] : n.raw, {
|
|
808
|
+
escapeSpecialCharacters: o = Array.isArray(n)
|
|
811
809
|
} = e;
|
|
812
|
-
let
|
|
813
|
-
for (let E = 0; E <
|
|
814
|
-
let d =
|
|
815
|
-
|
|
810
|
+
let i = "";
|
|
811
|
+
for (let E = 0; E < s.length; E++) {
|
|
812
|
+
let d = s[E];
|
|
813
|
+
o && (d = d.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\\{/g, "{")), i += d, E < r.length && (i += r[E]);
|
|
816
814
|
}
|
|
817
|
-
const l =
|
|
815
|
+
const l = i.split(`
|
|
818
816
|
`);
|
|
819
817
|
let u = null;
|
|
820
818
|
for (const E of l) {
|
|
@@ -826,17 +824,17 @@ function oi(e) {
|
|
|
826
824
|
}
|
|
827
825
|
if (u !== null) {
|
|
828
826
|
const E = u;
|
|
829
|
-
|
|
827
|
+
i = l.map((d) => d[0] === " " || d[0] === " " ? d.slice(E) : d).join(`
|
|
830
828
|
`);
|
|
831
829
|
}
|
|
832
|
-
return
|
|
833
|
-
`);
|
|
830
|
+
return i = i.trim(), o && (i = i.replace(/\\n/g, `
|
|
831
|
+
`)), i;
|
|
834
832
|
}
|
|
835
833
|
}
|
|
836
|
-
const { line: Bt, group: W, indent: qt, softline: jt } = M,
|
|
837
|
-
const
|
|
834
|
+
const { line: Bt, group: W, indent: qt, softline: jt } = M, ws = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
835
|
+
const i = {
|
|
838
836
|
...r,
|
|
839
|
-
...
|
|
837
|
+
...o
|
|
840
838
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
841
839
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
842
840
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
@@ -848,39 +846,39 @@ const { line: Bt, group: W, indent: qt, softline: jt } = M, Cs = async (e, t, n,
|
|
|
848
846
|
// https://github.com/prettier/prettier/blob/1079517b32e5bb145afa7acba448af51f8a7b6e6/src/language-js/embed/markdown.js#L15-L19
|
|
849
847
|
ri(f),
|
|
850
848
|
{
|
|
851
|
-
...
|
|
852
|
-
parser:
|
|
849
|
+
...i,
|
|
850
|
+
parser: i.embeddedMarkdownParser ?? "markdown",
|
|
853
851
|
// this will change the code fence delimiter from ``` to ~~~
|
|
854
852
|
// https://github.com/prettier/prettier/blob/1079517b32e5bb145afa7acba448af51f8a7b6e6/src/language-markdown/embed.js#L15
|
|
855
853
|
__inJsTemplate: !0
|
|
856
854
|
}
|
|
857
|
-
),
|
|
855
|
+
), a = S(
|
|
858
856
|
$,
|
|
859
857
|
E,
|
|
860
858
|
b,
|
|
861
859
|
!0
|
|
862
860
|
);
|
|
863
|
-
if (
|
|
861
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
864
862
|
return W([
|
|
865
863
|
"`",
|
|
866
864
|
c,
|
|
867
|
-
|
|
865
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [W(a)] : qt([W(a)]),
|
|
868
866
|
p,
|
|
869
867
|
"`"
|
|
870
868
|
]);
|
|
871
869
|
const h = c.length ? Bt : jt, v = p.length ? Bt : jt;
|
|
872
870
|
return W([
|
|
873
871
|
"`",
|
|
874
|
-
|
|
872
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, W(a)] : qt([h, W(a)]),
|
|
875
873
|
v,
|
|
876
874
|
"`"
|
|
877
875
|
]);
|
|
878
|
-
}, le = "embeddedMarkdown",
|
|
879
|
-
[
|
|
876
|
+
}, le = "embeddedMarkdown", Fs = ["md", "markdown"], Ws = ["markdown", "mdx", "remark"], zs = D(le), Ut = A(le), Rt = T(le), Ks = O(le), Js = {
|
|
877
|
+
[zs]: {
|
|
880
878
|
category: "Embed",
|
|
881
879
|
type: "string",
|
|
882
880
|
array: !0,
|
|
883
|
-
default: [{ value: [...
|
|
881
|
+
default: [{ value: [...Fs] }],
|
|
884
882
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Markdown language.",
|
|
885
883
|
deprecated: `Please use \`${Ut}\` or \`${Rt}\`.`
|
|
886
884
|
},
|
|
@@ -898,55 +896,55 @@ const { line: Bt, group: W, indent: qt, softline: jt } = M, Cs = async (e, t, n,
|
|
|
898
896
|
default: [{ value: [_] }],
|
|
899
897
|
description: "Tags that make their subsequent template literals be identified as embedded Markdown language."
|
|
900
898
|
},
|
|
901
|
-
[
|
|
899
|
+
[Ks]: {
|
|
902
900
|
category: "Embed",
|
|
903
901
|
type: "choice",
|
|
904
902
|
default: "markdown",
|
|
905
903
|
description: "The parser used to parse the embedded Markdown language.",
|
|
906
|
-
choices:
|
|
904
|
+
choices: Ws.map((e) => ({
|
|
907
905
|
value: e,
|
|
908
906
|
description: `Use the "${e}" parser.`
|
|
909
907
|
}))
|
|
910
908
|
}
|
|
911
|
-
},
|
|
909
|
+
}, Hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
912
910
|
__proto__: null,
|
|
913
|
-
embedder:
|
|
911
|
+
embedder: ws,
|
|
914
912
|
language: le,
|
|
915
|
-
options:
|
|
916
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Ct, group: z, indent: wt, softline: Ft } = M,
|
|
917
|
-
const
|
|
913
|
+
options: Js
|
|
914
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Ct, group: z, indent: wt, softline: Ft } = M, Xs = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
915
|
+
const i = {
|
|
918
916
|
...r,
|
|
919
|
-
...
|
|
917
|
+
...o
|
|
920
918
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
921
919
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
922
920
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
923
921
|
c.length,
|
|
924
922
|
-p.length || void 0
|
|
925
923
|
), b = k(n, t), $ = await e(f, {
|
|
926
|
-
...
|
|
924
|
+
...i,
|
|
927
925
|
parser: "nginx"
|
|
928
|
-
}),
|
|
929
|
-
if (
|
|
926
|
+
}), a = S($, E, b);
|
|
927
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
930
928
|
return z([
|
|
931
929
|
"`",
|
|
932
930
|
c,
|
|
933
|
-
|
|
931
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [z(a)] : wt([z(a)]),
|
|
934
932
|
p,
|
|
935
933
|
"`"
|
|
936
934
|
]);
|
|
937
935
|
const h = c.length ? Ct : Ft, v = p.length ? Ct : Ft;
|
|
938
936
|
return z([
|
|
939
937
|
"`",
|
|
940
|
-
|
|
938
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, z(a)] : wt([h, z(a)]),
|
|
941
939
|
v,
|
|
942
940
|
"`"
|
|
943
941
|
]);
|
|
944
|
-
}, De = "embeddedNginx",
|
|
945
|
-
[
|
|
942
|
+
}, De = "embeddedNginx", Qs = ["nginx"], Ys = D(De), Wt = A(De), zt = T(De), Vs = {
|
|
943
|
+
[Ys]: {
|
|
946
944
|
category: "Embed",
|
|
947
945
|
type: "string",
|
|
948
946
|
array: !0,
|
|
949
|
-
default: [{ value: [...
|
|
947
|
+
default: [{ value: [...Qs] }],
|
|
950
948
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin.",
|
|
951
949
|
deprecated: `Please use \`${Wt}\` or \`${zt}\`.`
|
|
952
950
|
},
|
|
@@ -964,13 +962,13 @@ const { line: Bt, group: W, indent: qt, softline: jt } = M, Cs = async (e, t, n,
|
|
|
964
962
|
default: [{ value: [_] }],
|
|
965
963
|
description: "Tags that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin."
|
|
966
964
|
}
|
|
967
|
-
},
|
|
965
|
+
}, Zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
968
966
|
__proto__: null,
|
|
969
|
-
embedder:
|
|
967
|
+
embedder: Xs,
|
|
970
968
|
language: De,
|
|
971
|
-
options:
|
|
972
|
-
}, Symbol.toStringTag, { value: "Module" })), ce = "embeddedNoop",
|
|
973
|
-
[
|
|
969
|
+
options: Vs
|
|
970
|
+
}, Symbol.toStringTag, { value: "Module" })), ce = "embeddedNoop", er = D(ce), Kt = A(ce), Jt = T(ce), tr = {
|
|
971
|
+
[er]: {
|
|
974
972
|
category: "Embed",
|
|
975
973
|
type: "string",
|
|
976
974
|
array: !0,
|
|
@@ -992,44 +990,44 @@ const { line: Bt, group: W, indent: qt, softline: jt } = M, Cs = async (e, t, n,
|
|
|
992
990
|
default: [{ value: [_] }],
|
|
993
991
|
description: "Tags that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted."
|
|
994
992
|
}
|
|
995
|
-
},
|
|
993
|
+
}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
996
994
|
__proto__: null,
|
|
997
995
|
language: ce,
|
|
998
|
-
options:
|
|
999
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Ht, group: K, indent: Xt, softline: Qt } = M,
|
|
1000
|
-
const
|
|
996
|
+
options: tr
|
|
997
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Ht, group: K, indent: Xt, softline: Qt } = M, ir = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
998
|
+
const i = {
|
|
1001
999
|
...r,
|
|
1002
|
-
...
|
|
1000
|
+
...o
|
|
1003
1001
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1004
1002
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
1005
1003
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1006
1004
|
c.length,
|
|
1007
1005
|
-p.length || void 0
|
|
1008
1006
|
), b = k(n, t), $ = await e(f, {
|
|
1009
|
-
...
|
|
1007
|
+
...i,
|
|
1010
1008
|
parser: "pegjs-parser"
|
|
1011
|
-
}),
|
|
1012
|
-
if (
|
|
1009
|
+
}), a = S($, E, b);
|
|
1010
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
1013
1011
|
return K([
|
|
1014
1012
|
"`",
|
|
1015
1013
|
c,
|
|
1016
|
-
|
|
1014
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [K(a)] : Xt([K(a)]),
|
|
1017
1015
|
p,
|
|
1018
1016
|
"`"
|
|
1019
1017
|
]);
|
|
1020
1018
|
const h = c.length ? Ht : Qt, v = p.length ? Ht : Qt;
|
|
1021
1019
|
return K([
|
|
1022
1020
|
"`",
|
|
1023
|
-
|
|
1021
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, K(a)] : Xt([h, K(a)]),
|
|
1024
1022
|
v,
|
|
1025
1023
|
"`"
|
|
1026
1024
|
]);
|
|
1027
|
-
}, Te = "embeddedPegjs",
|
|
1028
|
-
[
|
|
1025
|
+
}, Te = "embeddedPegjs", sr = ["pegjs", "peggy", "peg"], rr = D(Te), Yt = A(Te), Vt = T(Te), or = {
|
|
1026
|
+
[rr]: {
|
|
1029
1027
|
category: "Embed",
|
|
1030
1028
|
type: "string",
|
|
1031
1029
|
array: !0,
|
|
1032
|
-
default: [{ value: [...
|
|
1030
|
+
default: [{ value: [...sr] }],
|
|
1033
1031
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin.",
|
|
1034
1032
|
deprecated: `Please use \`${Yt}\` or \`${Vt}\`.`
|
|
1035
1033
|
},
|
|
@@ -1047,45 +1045,45 @@ const { line: Bt, group: W, indent: qt, softline: jt } = M, Cs = async (e, t, n,
|
|
|
1047
1045
|
default: [{ value: [_] }],
|
|
1048
1046
|
description: "Tags that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin."
|
|
1049
1047
|
}
|
|
1050
|
-
},
|
|
1048
|
+
}, ar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1051
1049
|
__proto__: null,
|
|
1052
|
-
embedder:
|
|
1050
|
+
embedder: ir,
|
|
1053
1051
|
language: Te,
|
|
1054
|
-
options:
|
|
1055
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Zt, group: J, indent: en, softline: tn } = M,
|
|
1056
|
-
const
|
|
1052
|
+
options: or
|
|
1053
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Zt, group: J, indent: en, softline: tn } = M, dr = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
1054
|
+
const i = {
|
|
1057
1055
|
...r,
|
|
1058
|
-
...
|
|
1056
|
+
...o
|
|
1059
1057
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L("$p"), d = l.quasis.map(
|
|
1060
1058
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
1061
1059
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1062
1060
|
c.length,
|
|
1063
1061
|
-p.length || void 0
|
|
1064
1062
|
), b = k(n, t), $ = await e(f, {
|
|
1065
|
-
...
|
|
1063
|
+
...i,
|
|
1066
1064
|
parser: "php"
|
|
1067
|
-
}),
|
|
1068
|
-
if (
|
|
1065
|
+
}), a = S($, E, b);
|
|
1066
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
1069
1067
|
return J([
|
|
1070
1068
|
"`",
|
|
1071
1069
|
c,
|
|
1072
|
-
|
|
1070
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [J(a)] : en([J(a)]),
|
|
1073
1071
|
p,
|
|
1074
1072
|
"`"
|
|
1075
1073
|
]);
|
|
1076
1074
|
const h = c.length ? Zt : tn, v = p.length ? Zt : tn;
|
|
1077
1075
|
return J([
|
|
1078
1076
|
"`",
|
|
1079
|
-
|
|
1077
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, J(a)] : en([h, J(a)]),
|
|
1080
1078
|
v,
|
|
1081
1079
|
"`"
|
|
1082
1080
|
]);
|
|
1083
|
-
}, Me = "embeddedPhp",
|
|
1084
|
-
[
|
|
1081
|
+
}, Me = "embeddedPhp", lr = ["php", "php5"], cr = D(Me), nn = A(Me), sn = T(Me), ur = {
|
|
1082
|
+
[cr]: {
|
|
1085
1083
|
category: "Embed",
|
|
1086
1084
|
type: "string",
|
|
1087
1085
|
array: !0,
|
|
1088
|
-
default: [{ value: [...
|
|
1086
|
+
default: [{ value: [...lr] }],
|
|
1089
1087
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin.",
|
|
1090
1088
|
deprecated: `Please use \`${nn}\` or \`${sn}\`.`
|
|
1091
1089
|
},
|
|
@@ -1103,45 +1101,45 @@ const { line: Bt, group: W, indent: qt, softline: jt } = M, Cs = async (e, t, n,
|
|
|
1103
1101
|
default: [{ value: [_] }],
|
|
1104
1102
|
description: "Tags that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin."
|
|
1105
1103
|
}
|
|
1106
|
-
},
|
|
1104
|
+
}, pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1107
1105
|
__proto__: null,
|
|
1108
|
-
embedder:
|
|
1106
|
+
embedder: dr,
|
|
1109
1107
|
language: Me,
|
|
1110
|
-
options:
|
|
1111
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: rn, group: H, indent: on, softline: an } = M,
|
|
1112
|
-
const
|
|
1108
|
+
options: ur
|
|
1109
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: rn, group: H, indent: on, softline: an } = M, gr = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
1110
|
+
const i = {
|
|
1113
1111
|
...r,
|
|
1114
|
-
...
|
|
1112
|
+
...o
|
|
1115
1113
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1116
1114
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
1117
1115
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1118
1116
|
c.length,
|
|
1119
1117
|
-p.length || void 0
|
|
1120
1118
|
), b = k(n, t), $ = await e(f, {
|
|
1121
|
-
...
|
|
1119
|
+
...i,
|
|
1122
1120
|
parser: "prisma-parse"
|
|
1123
|
-
}),
|
|
1124
|
-
if (
|
|
1121
|
+
}), a = S($, E, b);
|
|
1122
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
1125
1123
|
return H([
|
|
1126
1124
|
"`",
|
|
1127
1125
|
c,
|
|
1128
|
-
|
|
1126
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [H(a)] : on([H(a)]),
|
|
1129
1127
|
p,
|
|
1130
1128
|
"`"
|
|
1131
1129
|
]);
|
|
1132
1130
|
const h = c.length ? rn : an, v = p.length ? rn : an;
|
|
1133
1131
|
return H([
|
|
1134
1132
|
"`",
|
|
1135
|
-
|
|
1133
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, H(a)] : on([h, H(a)]),
|
|
1136
1134
|
v,
|
|
1137
1135
|
"`"
|
|
1138
1136
|
]);
|
|
1139
|
-
}, Ae = "embeddedPrisma",
|
|
1140
|
-
[
|
|
1137
|
+
}, Ae = "embeddedPrisma", mr = ["prisma"], hr = D(Ae), dn = A(Ae), ln = T(Ae), Er = {
|
|
1138
|
+
[hr]: {
|
|
1141
1139
|
category: "Embed",
|
|
1142
1140
|
type: "string",
|
|
1143
1141
|
array: !0,
|
|
1144
|
-
default: [{ value: [...
|
|
1142
|
+
default: [{ value: [...mr] }],
|
|
1145
1143
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin.",
|
|
1146
1144
|
deprecated: `Please use \`${dn}\` or \`${ln}\`.`
|
|
1147
1145
|
},
|
|
@@ -1159,45 +1157,45 @@ const { line: Bt, group: W, indent: qt, softline: jt } = M, Cs = async (e, t, n,
|
|
|
1159
1157
|
default: [{ value: [_] }],
|
|
1160
1158
|
description: "Tags that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin."
|
|
1161
1159
|
}
|
|
1162
|
-
},
|
|
1160
|
+
}, br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1163
1161
|
__proto__: null,
|
|
1164
|
-
embedder:
|
|
1162
|
+
embedder: gr,
|
|
1165
1163
|
language: Ae,
|
|
1166
|
-
options:
|
|
1167
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: cn, group: X, indent: un, softline: pn } = M,
|
|
1168
|
-
const
|
|
1164
|
+
options: Er
|
|
1165
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: cn, group: X, indent: un, softline: pn } = M, fr = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
1166
|
+
const i = {
|
|
1169
1167
|
...r,
|
|
1170
|
-
...
|
|
1168
|
+
...o
|
|
1171
1169
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1172
1170
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
1173
1171
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1174
1172
|
c.length,
|
|
1175
1173
|
-p.length || void 0
|
|
1176
1174
|
), b = k(n, t), $ = await e(f, {
|
|
1177
|
-
...
|
|
1175
|
+
...i,
|
|
1178
1176
|
parser: "dot-properties"
|
|
1179
|
-
}),
|
|
1180
|
-
if (
|
|
1177
|
+
}), a = S($, E, b);
|
|
1178
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
1181
1179
|
return X([
|
|
1182
1180
|
"`",
|
|
1183
1181
|
c,
|
|
1184
|
-
|
|
1182
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [X(a)] : un([X(a)]),
|
|
1185
1183
|
p,
|
|
1186
1184
|
"`"
|
|
1187
1185
|
]);
|
|
1188
1186
|
const h = c.length ? cn : pn, v = p.length ? cn : pn;
|
|
1189
1187
|
return X([
|
|
1190
1188
|
"`",
|
|
1191
|
-
|
|
1189
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, X(a)] : un([h, X(a)]),
|
|
1192
1190
|
v,
|
|
1193
1191
|
"`"
|
|
1194
1192
|
]);
|
|
1195
|
-
}, Se = "embeddedProperties",
|
|
1196
|
-
[
|
|
1193
|
+
}, Se = "embeddedProperties", yr = ["properties"], _r = D(Se), gn = A(Se), mn = T(Se), $r = {
|
|
1194
|
+
[_r]: {
|
|
1197
1195
|
category: "Embed",
|
|
1198
1196
|
type: "string",
|
|
1199
1197
|
array: !0,
|
|
1200
|
-
default: [{ value: [...
|
|
1198
|
+
default: [{ value: [...yr] }],
|
|
1201
1199
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin.",
|
|
1202
1200
|
deprecated: `Please use \`${gn}\` or \`${mn}\`.`
|
|
1203
1201
|
},
|
|
@@ -1215,50 +1213,50 @@ const { line: Bt, group: W, indent: qt, softline: jt } = M, Cs = async (e, t, n,
|
|
|
1215
1213
|
default: [{ value: [_] }],
|
|
1216
1214
|
description: "Tags that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin."
|
|
1217
1215
|
}
|
|
1218
|
-
},
|
|
1216
|
+
}, vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1219
1217
|
__proto__: null,
|
|
1220
|
-
embedder:
|
|
1218
|
+
embedder: fr,
|
|
1221
1219
|
language: Se,
|
|
1222
|
-
options:
|
|
1223
|
-
}, Symbol.toStringTag, { value: "Module" })), { group: Q, line: hn, softline: En, indent: bn } = M,
|
|
1224
|
-
const
|
|
1220
|
+
options: $r
|
|
1221
|
+
}, Symbol.toStringTag, { value: "Module" })), { group: Q, line: hn, softline: En, indent: bn } = M, Dr = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
1222
|
+
const i = {
|
|
1225
1223
|
...r,
|
|
1226
|
-
...
|
|
1224
|
+
...o
|
|
1227
1225
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1228
1226
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
1229
1227
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1230
1228
|
c.length,
|
|
1231
1229
|
-p.length || void 0
|
|
1232
1230
|
), b = k(n, t), $ = await e(f, {
|
|
1233
|
-
...
|
|
1231
|
+
...i,
|
|
1234
1232
|
parser: "pug"
|
|
1235
|
-
}),
|
|
1233
|
+
}), a = S(
|
|
1236
1234
|
$,
|
|
1237
1235
|
E,
|
|
1238
1236
|
b,
|
|
1239
1237
|
!0
|
|
1240
1238
|
);
|
|
1241
|
-
if (
|
|
1239
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
1242
1240
|
return Q([
|
|
1243
1241
|
"`",
|
|
1244
1242
|
c,
|
|
1245
|
-
|
|
1243
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [Q(a)] : bn([Q(a)]),
|
|
1246
1244
|
p,
|
|
1247
1245
|
"`"
|
|
1248
1246
|
]);
|
|
1249
1247
|
const h = c.length ? hn : En, v = p.length ? hn : En;
|
|
1250
1248
|
return Q([
|
|
1251
1249
|
"`",
|
|
1252
|
-
|
|
1250
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, Q(a)] : bn([h, Q(a)]),
|
|
1253
1251
|
v,
|
|
1254
1252
|
"`"
|
|
1255
1253
|
]);
|
|
1256
|
-
}, ke = "embeddedPug",
|
|
1257
|
-
[
|
|
1254
|
+
}, ke = "embeddedPug", Tr = ["pug", "jade"], Mr = D(ke), fn = A(ke), yn = T(ke), Ar = {
|
|
1255
|
+
[Mr]: {
|
|
1258
1256
|
category: "Embed",
|
|
1259
1257
|
type: "string",
|
|
1260
1258
|
array: !0,
|
|
1261
|
-
default: [{ value: [...
|
|
1259
|
+
default: [{ value: [...Tr] }],
|
|
1262
1260
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin.",
|
|
1263
1261
|
deprecated: `Please use \`${fn}\` or \`${yn}\`.`
|
|
1264
1262
|
},
|
|
@@ -1276,45 +1274,45 @@ const { line: Bt, group: W, indent: qt, softline: jt } = M, Cs = async (e, t, n,
|
|
|
1276
1274
|
default: [{ value: [_] }],
|
|
1277
1275
|
description: "Tags that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin."
|
|
1278
1276
|
}
|
|
1279
|
-
},
|
|
1277
|
+
}, Sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1280
1278
|
__proto__: null,
|
|
1281
|
-
embedder:
|
|
1279
|
+
embedder: Dr,
|
|
1282
1280
|
language: ke,
|
|
1283
|
-
options:
|
|
1284
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: _n, group: Y, indent: $n, softline: vn } = M,
|
|
1285
|
-
const
|
|
1281
|
+
options: Ar
|
|
1282
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: _n, group: Y, indent: $n, softline: vn } = M, kr = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
1283
|
+
const i = {
|
|
1286
1284
|
...r,
|
|
1287
|
-
...
|
|
1285
|
+
...o
|
|
1288
1286
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1289
1287
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
1290
1288
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1291
1289
|
c.length,
|
|
1292
1290
|
-p.length || void 0
|
|
1293
1291
|
), b = k(n, t), $ = await e(f, {
|
|
1294
|
-
...
|
|
1295
|
-
parser:
|
|
1296
|
-
}),
|
|
1297
|
-
if (
|
|
1292
|
+
...i,
|
|
1293
|
+
parser: i.embeddedRubyParser ?? "ruby"
|
|
1294
|
+
}), a = S($, E, b);
|
|
1295
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
1298
1296
|
return Y([
|
|
1299
1297
|
"`",
|
|
1300
1298
|
c,
|
|
1301
|
-
|
|
1299
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [Y(a)] : $n([Y(a)]),
|
|
1302
1300
|
p,
|
|
1303
1301
|
"`"
|
|
1304
1302
|
]);
|
|
1305
1303
|
const h = c.length ? _n : vn, v = p.length ? _n : vn;
|
|
1306
1304
|
return Y([
|
|
1307
1305
|
"`",
|
|
1308
|
-
|
|
1306
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, Y(a)] : $n([h, Y(a)]),
|
|
1309
1307
|
v,
|
|
1310
1308
|
"`"
|
|
1311
1309
|
]);
|
|
1312
|
-
}, ue = "embeddedRuby",
|
|
1313
|
-
[
|
|
1310
|
+
}, ue = "embeddedRuby", Lr = ["ruby"], Gr = ["ruby", "rbs", "haml"], Nr = D(ue), Dn = A(ue), Tn = T(ue), Or = O(ue), xr = {
|
|
1311
|
+
[Nr]: {
|
|
1314
1312
|
category: "Embed",
|
|
1315
1313
|
type: "string",
|
|
1316
1314
|
array: !0,
|
|
1317
|
-
default: [{ value: [...
|
|
1315
|
+
default: [{ value: [...Lr] }],
|
|
1318
1316
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin.",
|
|
1319
1317
|
deprecated: `Please use \`${Dn}\` or \`${Tn}\`.`
|
|
1320
1318
|
},
|
|
@@ -1332,60 +1330,60 @@ const { line: Bt, group: W, indent: qt, softline: jt } = M, Cs = async (e, t, n,
|
|
|
1332
1330
|
default: [{ value: [_] }],
|
|
1333
1331
|
description: "Tags that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin."
|
|
1334
1332
|
},
|
|
1335
|
-
[
|
|
1333
|
+
[Or]: {
|
|
1336
1334
|
category: "Embed",
|
|
1337
1335
|
type: "choice",
|
|
1338
1336
|
default: "ruby",
|
|
1339
1337
|
description: "The parser used to parse the embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin.",
|
|
1340
|
-
choices:
|
|
1338
|
+
choices: Gr.map((e) => ({
|
|
1341
1339
|
value: e,
|
|
1342
1340
|
description: `Use the "${e}" parser.`
|
|
1343
1341
|
}))
|
|
1344
1342
|
}
|
|
1345
|
-
},
|
|
1343
|
+
}, Ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1346
1344
|
__proto__: null,
|
|
1347
|
-
embedder:
|
|
1345
|
+
embedder: kr,
|
|
1348
1346
|
language: ue,
|
|
1349
|
-
options:
|
|
1350
|
-
}, Symbol.toStringTag, { value: "Module" })), { group: V, line: Mn, softline: An, indent: Sn } = M,
|
|
1351
|
-
const
|
|
1347
|
+
options: xr
|
|
1348
|
+
}, Symbol.toStringTag, { value: "Module" })), { group: V, line: Mn, softline: An, indent: Sn } = M, Pr = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
1349
|
+
const i = {
|
|
1352
1350
|
...r,
|
|
1353
|
-
...
|
|
1351
|
+
...o
|
|
1354
1352
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1355
1353
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
1356
1354
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1357
1355
|
c.length,
|
|
1358
1356
|
-p.length || void 0
|
|
1359
1357
|
), b = k(n, t), $ = await e(f, {
|
|
1360
|
-
...
|
|
1358
|
+
...i,
|
|
1361
1359
|
parser: "sh"
|
|
1362
|
-
}),
|
|
1360
|
+
}), a = S(
|
|
1363
1361
|
$,
|
|
1364
1362
|
E,
|
|
1365
1363
|
b,
|
|
1366
1364
|
!0
|
|
1367
1365
|
);
|
|
1368
|
-
if (
|
|
1366
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
1369
1367
|
return V([
|
|
1370
1368
|
"`",
|
|
1371
1369
|
c,
|
|
1372
|
-
|
|
1370
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [V(a)] : Sn([V(a)]),
|
|
1373
1371
|
p,
|
|
1374
1372
|
"`"
|
|
1375
1373
|
]);
|
|
1376
1374
|
const h = c.length ? Mn : An, v = p.length ? Mn : An;
|
|
1377
1375
|
return V([
|
|
1378
1376
|
"`",
|
|
1379
|
-
|
|
1377
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, V(a)] : Sn([h, V(a)]),
|
|
1380
1378
|
v,
|
|
1381
1379
|
"`"
|
|
1382
1380
|
]);
|
|
1383
|
-
}, Le = "embeddedSh",
|
|
1384
|
-
[
|
|
1381
|
+
}, Le = "embeddedSh", Br = ["sh"], qr = D(Le), kn = A(Le), Ln = T(Le), jr = {
|
|
1382
|
+
[qr]: {
|
|
1385
1383
|
category: "Embed",
|
|
1386
1384
|
type: "string",
|
|
1387
1385
|
array: !0,
|
|
1388
|
-
default: [{ value: [...
|
|
1386
|
+
default: [{ value: [...Br] }],
|
|
1389
1387
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin.",
|
|
1390
1388
|
deprecated: `Please use \`${kn}\` or \`${Ln}\`.`
|
|
1391
1389
|
},
|
|
@@ -1403,67 +1401,67 @@ const { line: Bt, group: W, indent: qt, softline: jt } = M, Cs = async (e, t, n,
|
|
|
1403
1401
|
default: [{ value: [_] }],
|
|
1404
1402
|
description: "Tags that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin."
|
|
1405
1403
|
}
|
|
1406
|
-
},
|
|
1404
|
+
}, Ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1407
1405
|
__proto__: null,
|
|
1408
|
-
embedder:
|
|
1406
|
+
embedder: Pr,
|
|
1409
1407
|
language: Le,
|
|
1410
|
-
options:
|
|
1411
|
-
}, Symbol.toStringTag, { value: "Module" })), { group: Z, line: Gn, softline: Nn, indent: On } = M,
|
|
1412
|
-
const
|
|
1408
|
+
options: jr
|
|
1409
|
+
}, Symbol.toStringTag, { value: "Module" })), { group: Z, line: Gn, softline: Nn, indent: On } = M, Rr = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
1410
|
+
const i = {
|
|
1413
1411
|
...r,
|
|
1414
|
-
...
|
|
1415
|
-
}, l =
|
|
1412
|
+
...o
|
|
1413
|
+
}, l = i.embeddedSqlPlugin ?? "prettier-plugin-sql", { node: u } = n, { createPlaceholder: E, placeholderRegex: d } = L(), c = u.quasis.map(
|
|
1416
1414
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + E(g)
|
|
1417
1415
|
).join(""), p = c.match(/^\s+/)?.[0] ?? "", f = c.match(/\s+$/)?.[0] ?? "", b = c.slice(
|
|
1418
1416
|
p.length,
|
|
1419
1417
|
-f.length || void 0
|
|
1420
1418
|
), $ = k(n, t);
|
|
1421
|
-
let
|
|
1419
|
+
let a;
|
|
1422
1420
|
if (l === "prettier-plugin-sql-cst") {
|
|
1423
1421
|
const m = await e(b, {
|
|
1424
|
-
...
|
|
1425
|
-
parser:
|
|
1422
|
+
...i,
|
|
1423
|
+
parser: i.embeddedSqlParser ?? "sqlite"
|
|
1426
1424
|
});
|
|
1427
|
-
|
|
1425
|
+
a = S(m, d, $);
|
|
1428
1426
|
} else {
|
|
1429
1427
|
const m = await e(ri(b), {
|
|
1430
|
-
...
|
|
1428
|
+
...i,
|
|
1431
1429
|
parser: "sql"
|
|
1432
1430
|
});
|
|
1433
|
-
|
|
1431
|
+
a = S(
|
|
1434
1432
|
m,
|
|
1435
1433
|
d,
|
|
1436
1434
|
$,
|
|
1437
1435
|
!0
|
|
1438
1436
|
);
|
|
1439
1437
|
}
|
|
1440
|
-
if (
|
|
1438
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
1441
1439
|
return Z([
|
|
1442
1440
|
"`",
|
|
1443
1441
|
p,
|
|
1444
|
-
|
|
1442
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [Z(a)] : On([Z(a)]),
|
|
1445
1443
|
f,
|
|
1446
1444
|
"`"
|
|
1447
1445
|
]);
|
|
1448
1446
|
const h = p.length ? Gn : Nn, v = f.length ? Gn : Nn;
|
|
1449
1447
|
return Z([
|
|
1450
1448
|
"`",
|
|
1451
|
-
|
|
1449
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, Z(a)] : On([h, Z(a)]),
|
|
1452
1450
|
v,
|
|
1453
1451
|
"`"
|
|
1454
1452
|
]);
|
|
1455
|
-
}, se = "embeddedSql",
|
|
1453
|
+
}, se = "embeddedSql", Cr = ["sql"], wr = ["prettier-plugin-sql", "prettier-plugin-sql-cst"], Fr = [
|
|
1456
1454
|
"sqlite",
|
|
1457
1455
|
"bigquery",
|
|
1458
1456
|
"mysql",
|
|
1459
1457
|
"mariadb",
|
|
1460
1458
|
"postgresql"
|
|
1461
|
-
],
|
|
1462
|
-
[
|
|
1459
|
+
], Wr = D(se), xn = A(se), In = T(se), zr = Oi(se), Kr = O(se), Jr = {
|
|
1460
|
+
[Wr]: {
|
|
1463
1461
|
category: "Embed",
|
|
1464
1462
|
type: "string",
|
|
1465
1463
|
array: !0,
|
|
1466
|
-
default: [{ value: [...
|
|
1464
|
+
default: [{ value: [...Cr] }],
|
|
1467
1465
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin.",
|
|
1468
1466
|
deprecated: `Please use \`${xn}\` or \`${In}\`.`
|
|
1469
1467
|
},
|
|
@@ -1481,70 +1479,70 @@ const { line: Bt, group: W, indent: qt, softline: jt } = M, Cs = async (e, t, n,
|
|
|
1481
1479
|
default: [{ value: [_] }],
|
|
1482
1480
|
description: "Tags that make their subsequent template literals be identified as embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin."
|
|
1483
1481
|
},
|
|
1484
|
-
[
|
|
1482
|
+
[zr]: {
|
|
1485
1483
|
category: "Embed",
|
|
1486
1484
|
type: "choice",
|
|
1487
1485
|
default: "prettier-plugin-sql",
|
|
1488
1486
|
description: "The plugin used to format the embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin.",
|
|
1489
|
-
choices:
|
|
1487
|
+
choices: wr.map((e) => ({
|
|
1490
1488
|
value: e,
|
|
1491
1489
|
description: `Use the "${e}" plugin.`
|
|
1492
1490
|
}))
|
|
1493
1491
|
},
|
|
1494
|
-
[
|
|
1492
|
+
[Kr]: {
|
|
1495
1493
|
category: "Embed",
|
|
1496
1494
|
type: "choice",
|
|
1497
1495
|
default: "sqlite",
|
|
1498
1496
|
description: "Specify the embedded SQL language parser. This option is only needed with the `prettier-plugin-sql-cst` plugin.",
|
|
1499
|
-
choices:
|
|
1497
|
+
choices: Fr.map((e) => ({
|
|
1500
1498
|
value: e,
|
|
1501
1499
|
description: `Use the "${e}" parser.`
|
|
1502
1500
|
}))
|
|
1503
1501
|
}
|
|
1504
|
-
},
|
|
1502
|
+
}, Hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1505
1503
|
__proto__: null,
|
|
1506
|
-
embedder:
|
|
1504
|
+
embedder: Rr,
|
|
1507
1505
|
language: se,
|
|
1508
|
-
options:
|
|
1509
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Pn, group: ee, indent: Bn, softline: qn } = M,
|
|
1510
|
-
const
|
|
1506
|
+
options: Jr
|
|
1507
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Pn, group: ee, indent: Bn, softline: qn } = M, Xr = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
1508
|
+
const i = {
|
|
1511
1509
|
...r,
|
|
1512
|
-
...
|
|
1510
|
+
...o
|
|
1513
1511
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1514
1512
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
1515
1513
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1516
1514
|
c.length,
|
|
1517
1515
|
-p.length || void 0
|
|
1518
1516
|
), b = k(n, t), $ = await e(f, {
|
|
1519
|
-
...
|
|
1517
|
+
...i,
|
|
1520
1518
|
parser: "toml"
|
|
1521
|
-
}),
|
|
1519
|
+
}), a = S(
|
|
1522
1520
|
$,
|
|
1523
1521
|
E,
|
|
1524
1522
|
b,
|
|
1525
1523
|
!0
|
|
1526
1524
|
);
|
|
1527
|
-
if (
|
|
1525
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
1528
1526
|
return ee([
|
|
1529
1527
|
"`",
|
|
1530
1528
|
c,
|
|
1531
|
-
|
|
1529
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [ee(a)] : Bn([ee(a)]),
|
|
1532
1530
|
p,
|
|
1533
1531
|
"`"
|
|
1534
1532
|
]);
|
|
1535
1533
|
const h = c.length ? Pn : qn, v = p.length ? Pn : qn;
|
|
1536
1534
|
return ee([
|
|
1537
1535
|
"`",
|
|
1538
|
-
|
|
1536
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, ee(a)] : Bn([h, ee(a)]),
|
|
1539
1537
|
v,
|
|
1540
1538
|
"`"
|
|
1541
1539
|
]);
|
|
1542
|
-
}, Ge = "embeddedToml",
|
|
1543
|
-
[
|
|
1540
|
+
}, Ge = "embeddedToml", Qr = ["toml"], Yr = D(Ge), jn = A(Ge), Un = T(Ge), Vr = {
|
|
1541
|
+
[Yr]: {
|
|
1544
1542
|
category: "Embed",
|
|
1545
1543
|
type: "string",
|
|
1546
1544
|
array: !0,
|
|
1547
|
-
default: [{ value: [...
|
|
1545
|
+
default: [{ value: [...Qr] }],
|
|
1548
1546
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin.",
|
|
1549
1547
|
deprecated: `Please use \`${jn}\` or \`${Un}\`.`
|
|
1550
1548
|
},
|
|
@@ -1562,54 +1560,54 @@ const { line: Bt, group: W, indent: qt, softline: jt } = M, Cs = async (e, t, n,
|
|
|
1562
1560
|
default: [{ value: [_] }],
|
|
1563
1561
|
description: "Tags that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin."
|
|
1564
1562
|
}
|
|
1565
|
-
},
|
|
1563
|
+
}, Zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1566
1564
|
__proto__: null,
|
|
1567
|
-
embedder:
|
|
1565
|
+
embedder: Xr,
|
|
1568
1566
|
language: Ge,
|
|
1569
|
-
options:
|
|
1570
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Rn, group: te, indent: Cn, softline: wn } = M,
|
|
1571
|
-
const
|
|
1567
|
+
options: Vr
|
|
1568
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Rn, group: te, indent: Cn, softline: wn } = M, eo = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
1569
|
+
const i = {
|
|
1572
1570
|
...r,
|
|
1573
|
-
...
|
|
1571
|
+
...o
|
|
1574
1572
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1575
1573
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
1576
1574
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1577
1575
|
c.length,
|
|
1578
1576
|
-p.length || void 0
|
|
1579
1577
|
), b = k(n, t), $ = await e(f, {
|
|
1580
|
-
...
|
|
1581
|
-
parser:
|
|
1578
|
+
...i,
|
|
1579
|
+
parser: i.embeddedTsParser ?? "typescript",
|
|
1582
1580
|
// set filepath to undefined to enable jsx auto detection:
|
|
1583
1581
|
// https://github.com/prettier/prettier/blob/427a84d24203e2d54160cde153a1e6a6390fe65a/src/language-js/parse/typescript.js#L49-L53
|
|
1584
1582
|
filepath: void 0
|
|
1585
|
-
}),
|
|
1586
|
-
if (
|
|
1583
|
+
}), a = S($, E, b);
|
|
1584
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
1587
1585
|
return te([
|
|
1588
1586
|
"`",
|
|
1589
1587
|
c,
|
|
1590
|
-
|
|
1588
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [te(a)] : Cn([te(a)]),
|
|
1591
1589
|
p,
|
|
1592
1590
|
"`"
|
|
1593
1591
|
]);
|
|
1594
1592
|
const h = c.length ? Rn : wn, v = p.length ? Rn : wn;
|
|
1595
1593
|
return te([
|
|
1596
1594
|
"`",
|
|
1597
|
-
|
|
1595
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, te(a)] : Cn([h, te(a)]),
|
|
1598
1596
|
v,
|
|
1599
1597
|
"`"
|
|
1600
1598
|
]);
|
|
1601
|
-
}, pe = "embeddedTs",
|
|
1599
|
+
}, pe = "embeddedTs", to = [
|
|
1602
1600
|
"ts",
|
|
1603
1601
|
"tsx",
|
|
1604
1602
|
"cts",
|
|
1605
1603
|
"mts",
|
|
1606
1604
|
"typescript"
|
|
1607
|
-
],
|
|
1608
|
-
[
|
|
1605
|
+
], no = ["typescript", "babel-ts"], io = D(pe), Fn = A(pe), Wn = T(pe), so = O(pe), ro = {
|
|
1606
|
+
[io]: {
|
|
1609
1607
|
category: "Embed",
|
|
1610
1608
|
type: "string",
|
|
1611
1609
|
array: !0,
|
|
1612
|
-
default: [{ value: [...
|
|
1610
|
+
default: [{ value: [...to] }],
|
|
1613
1611
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TypeScript language.",
|
|
1614
1612
|
deprecated: `Please use \`${Fn}\` or \`${Wn}\`.`
|
|
1615
1613
|
},
|
|
@@ -1627,69 +1625,69 @@ const { line: Bt, group: W, indent: qt, softline: jt } = M, Cs = async (e, t, n,
|
|
|
1627
1625
|
default: [{ value: [_] }],
|
|
1628
1626
|
description: "Tags that make their subsequent template literals be identified as embedded TypeScript language."
|
|
1629
1627
|
},
|
|
1630
|
-
[
|
|
1628
|
+
[so]: {
|
|
1631
1629
|
category: "Embed",
|
|
1632
1630
|
type: "choice",
|
|
1633
1631
|
default: "typescript",
|
|
1634
1632
|
description: "The parser used to parse the embedded TypeScript language.",
|
|
1635
|
-
choices:
|
|
1633
|
+
choices: no.map((e) => ({
|
|
1636
1634
|
value: e,
|
|
1637
1635
|
description: `Use the "${e}" parser.`
|
|
1638
1636
|
}))
|
|
1639
1637
|
}
|
|
1640
|
-
},
|
|
1638
|
+
}, oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1641
1639
|
__proto__: null,
|
|
1642
|
-
embedder:
|
|
1640
|
+
embedder: eo,
|
|
1643
1641
|
language: pe,
|
|
1644
|
-
options:
|
|
1645
|
-
}, Symbol.toStringTag, { value: "Module" })), ge = "embeddedXml", { line: zn, group: ne, indent: Kn, softline: Oe } = M,
|
|
1646
|
-
const
|
|
1642
|
+
options: ro
|
|
1643
|
+
}, Symbol.toStringTag, { value: "Module" })), ge = "embeddedXml", { line: zn, group: ne, indent: Kn, softline: Oe } = M, ao = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
1644
|
+
const i = {
|
|
1647
1645
|
...r,
|
|
1648
|
-
...
|
|
1646
|
+
...o
|
|
1649
1647
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1650
1648
|
(g, y, { length: G }) => y === G - 1 ? g.value.cooked : g.value.cooked + u(y)
|
|
1651
1649
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1652
1650
|
c.length,
|
|
1653
1651
|
-p.length || void 0
|
|
1654
1652
|
), b = k(n, t), $ = [];
|
|
1655
|
-
let
|
|
1656
|
-
for (;
|
|
1657
|
-
const g = f.slice(
|
|
1653
|
+
let a = 0;
|
|
1654
|
+
for (; a !== void 0; ) {
|
|
1655
|
+
const g = f.slice(a);
|
|
1658
1656
|
if (g.length === 0)
|
|
1659
1657
|
break;
|
|
1660
|
-
|
|
1658
|
+
a > 0 && i.xmlWhitespaceSensitivity !== "strict" && $.push(Oe), i.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
1661
1659
|
0,
|
|
1662
|
-
|
|
1660
|
+
i.__embeddedXmlFragmentRecoverIndex.length
|
|
1663
1661
|
);
|
|
1664
1662
|
let y = await e(g, {
|
|
1665
|
-
...
|
|
1663
|
+
...i,
|
|
1666
1664
|
parser: ge
|
|
1667
1665
|
});
|
|
1668
|
-
const [G, N] =
|
|
1669
|
-
G === void 0 ?
|
|
1666
|
+
const [G, N] = i.__embeddedXmlFragmentRecoverIndex ?? [];
|
|
1667
|
+
G === void 0 ? a = void 0 : N === void 0 ? a += G : (y = g.slice(G, N + 1), a += N + 1), $.push(y);
|
|
1670
1668
|
}
|
|
1671
1669
|
const h = S($, E, b);
|
|
1672
|
-
if (
|
|
1670
|
+
if (i.xmlWhitespaceSensitivity === "strict" || i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
1673
1671
|
return ne([
|
|
1674
1672
|
"`",
|
|
1675
1673
|
c,
|
|
1676
|
-
|
|
1674
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [ne(h)] : Kn([ne(h)]),
|
|
1677
1675
|
p,
|
|
1678
1676
|
"`"
|
|
1679
1677
|
]);
|
|
1680
1678
|
const v = c.length ? zn : Oe, m = p.length ? zn : Oe;
|
|
1681
1679
|
return ne([
|
|
1682
1680
|
"`",
|
|
1683
|
-
|
|
1681
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [v, ne(h)] : Kn([v, ne(h)]),
|
|
1684
1682
|
m,
|
|
1685
1683
|
"`"
|
|
1686
1684
|
]);
|
|
1687
|
-
},
|
|
1688
|
-
[
|
|
1685
|
+
}, lo = ["xml", "opml", "rss", "svg"], co = D(ge), Jn = A(ge), Hn = T(ge), uo = {
|
|
1686
|
+
[co]: {
|
|
1689
1687
|
category: "Embed",
|
|
1690
1688
|
type: "string",
|
|
1691
1689
|
array: !0,
|
|
1692
|
-
default: [{ value: [...
|
|
1690
|
+
default: [{ value: [...lo] }],
|
|
1693
1691
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin.",
|
|
1694
1692
|
deprecated: `Please use \`${Jn}\` or \`${Hn}\`.`
|
|
1695
1693
|
},
|
|
@@ -1718,7 +1716,7 @@ const { line: Bt, group: W, indent: qt, softline: jt } = M, Cs = async (e, t, n,
|
|
|
1718
1716
|
description: "This option is read only and is used internally as a workaround to support xml fragments"
|
|
1719
1717
|
}
|
|
1720
1718
|
};
|
|
1721
|
-
function
|
|
1719
|
+
function po(e) {
|
|
1722
1720
|
const t = {
|
|
1723
1721
|
loc: {
|
|
1724
1722
|
start: {
|
|
@@ -1742,12 +1740,12 @@ function Xn(e) {
|
|
|
1742
1740
|
const t = {
|
|
1743
1741
|
loc: {
|
|
1744
1742
|
start: {
|
|
1745
|
-
line: e.token.startLine ?? NaN,
|
|
1746
|
-
column: e.token.startColumn ?? NaN
|
|
1743
|
+
line: e.token.startLine ?? Number.NaN,
|
|
1744
|
+
column: e.token.startColumn ?? Number.NaN
|
|
1747
1745
|
},
|
|
1748
1746
|
end: {
|
|
1749
|
-
line: e.token.endLine ?? NaN,
|
|
1750
|
-
column: e.token.endColumn ?? NaN
|
|
1747
|
+
line: e.token.endLine ?? Number.NaN,
|
|
1748
|
+
column: e.token.endColumn ?? Number.NaN
|
|
1751
1749
|
}
|
|
1752
1750
|
}
|
|
1753
1751
|
}, n = new SyntaxError(
|
|
@@ -1758,22 +1756,22 @@ function Xn(e) {
|
|
|
1758
1756
|
);
|
|
1759
1757
|
return Object.assign(n, t), n;
|
|
1760
1758
|
}
|
|
1761
|
-
const
|
|
1759
|
+
const go = {
|
|
1762
1760
|
async parse(e, t) {
|
|
1763
|
-
const { parse: n } = await import("@xml-tools/parser"), { lexErrors: r, parseErrors:
|
|
1761
|
+
const { parse: n } = await import("@xml-tools/parser"), { lexErrors: r, parseErrors: s, cst: o } = n(e);
|
|
1764
1762
|
if (r.length > 0) {
|
|
1765
|
-
const
|
|
1766
|
-
throw
|
|
1763
|
+
const i = r[0];
|
|
1764
|
+
throw po(i);
|
|
1767
1765
|
}
|
|
1768
|
-
if (
|
|
1769
|
-
let
|
|
1770
|
-
for (const l of
|
|
1766
|
+
if (s.length > 0) {
|
|
1767
|
+
let i = !1;
|
|
1768
|
+
for (const l of s) {
|
|
1771
1769
|
if (!["MismatchedTokenException", "NotAllInputParsedException"].includes(
|
|
1772
1770
|
l.name
|
|
1773
1771
|
))
|
|
1774
1772
|
throw Xn(l);
|
|
1775
1773
|
if (l.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
|
|
1776
|
-
|
|
1774
|
+
i = !0;
|
|
1777
1775
|
continue;
|
|
1778
1776
|
}
|
|
1779
1777
|
if (/Expecting token of type --> EOF <-- but found --> '[\s\S]+' <--/.test(
|
|
@@ -1796,82 +1794,82 @@ const po = {
|
|
|
1796
1794
|
t.__embeddedXmlFragmentRecoverIndex.length,
|
|
1797
1795
|
l.token.startOffset,
|
|
1798
1796
|
l.token.endOffset
|
|
1799
|
-
),
|
|
1797
|
+
), i = !0;
|
|
1800
1798
|
break;
|
|
1801
1799
|
}
|
|
1802
1800
|
throw Xn(l);
|
|
1803
1801
|
}
|
|
1804
|
-
|
|
1802
|
+
i && ai(o);
|
|
1805
1803
|
}
|
|
1806
|
-
return
|
|
1804
|
+
return o;
|
|
1807
1805
|
},
|
|
1808
1806
|
astFormat: "xml",
|
|
1809
1807
|
locStart(e) {
|
|
1810
1808
|
return e.location.startOffset;
|
|
1811
1809
|
},
|
|
1812
1810
|
locEnd(e) {
|
|
1813
|
-
return e.location.endOffset ?? NaN;
|
|
1811
|
+
return e.location.endOffset ?? Number.NaN;
|
|
1814
1812
|
}
|
|
1815
1813
|
};
|
|
1816
1814
|
function ai(e) {
|
|
1817
1815
|
const t = e.children;
|
|
1818
1816
|
for (const n in t) {
|
|
1819
1817
|
const r = t[n] ?? [];
|
|
1820
|
-
for (let
|
|
1821
|
-
const
|
|
1822
|
-
if (
|
|
1823
|
-
if (Object.keys(
|
|
1824
|
-
r.splice(
|
|
1818
|
+
for (let s = r.length - 1; s >= 0; --s) {
|
|
1819
|
+
const o = r[s];
|
|
1820
|
+
if (mo(o)) {
|
|
1821
|
+
if (Object.keys(o.children).length === 0) {
|
|
1822
|
+
r.splice(s, 1), r.length === 0 && delete t[n];
|
|
1825
1823
|
continue;
|
|
1826
1824
|
}
|
|
1827
|
-
ai(
|
|
1825
|
+
ai(o);
|
|
1828
1826
|
}
|
|
1829
1827
|
}
|
|
1830
1828
|
}
|
|
1831
1829
|
}
|
|
1832
|
-
function
|
|
1830
|
+
function mo(e) {
|
|
1833
1831
|
return "name" in e && "children" in e && "location" in e;
|
|
1834
1832
|
}
|
|
1835
|
-
const
|
|
1833
|
+
const ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1836
1834
|
__proto__: null,
|
|
1837
|
-
embedder:
|
|
1835
|
+
embedder: ao,
|
|
1838
1836
|
language: ge,
|
|
1839
|
-
options:
|
|
1840
|
-
parser:
|
|
1841
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Qn, group: ie, indent: Yn, softline: Vn } = M,
|
|
1842
|
-
const
|
|
1837
|
+
options: uo,
|
|
1838
|
+
parser: go
|
|
1839
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Qn, group: ie, indent: Yn, softline: Vn } = M, Eo = async (e, t, n, r, { commentOrTag: s, embeddedOverrideOptions: o }) => {
|
|
1840
|
+
const i = {
|
|
1843
1841
|
...r,
|
|
1844
|
-
...
|
|
1842
|
+
...o
|
|
1845
1843
|
}, { node: l } = n, { createPlaceholder: u, placeholderRegex: E } = L(), d = l.quasis.map(
|
|
1846
1844
|
(m, g, { length: y }) => g === y - 1 ? m.value.cooked : m.value.cooked + u(g)
|
|
1847
1845
|
).join(""), c = d.match(/^\s+/)?.[0] ?? "", p = d.match(/\s+$/)?.[0] ?? "", f = d.slice(
|
|
1848
1846
|
c.length,
|
|
1849
1847
|
-p.length || void 0
|
|
1850
1848
|
), b = k(n, t), $ = await e(f, {
|
|
1851
|
-
...
|
|
1849
|
+
...i,
|
|
1852
1850
|
parser: "yaml"
|
|
1853
|
-
}),
|
|
1854
|
-
if (
|
|
1851
|
+
}), a = S($, E, b);
|
|
1852
|
+
if (i.preserveEmbeddedExteriorWhitespaces?.includes(s))
|
|
1855
1853
|
return ie([
|
|
1856
1854
|
"`",
|
|
1857
1855
|
c,
|
|
1858
|
-
|
|
1856
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [ie(a)] : Yn([ie(a)]),
|
|
1859
1857
|
p,
|
|
1860
1858
|
"`"
|
|
1861
1859
|
]);
|
|
1862
1860
|
const h = c.length ? Qn : Vn, v = p.length ? Qn : Vn;
|
|
1863
1861
|
return ie([
|
|
1864
1862
|
"`",
|
|
1865
|
-
|
|
1863
|
+
i.noEmbeddedMultiLineIndentation?.includes(s) ? [h, ie(a)] : Yn([h, ie(a)]),
|
|
1866
1864
|
v,
|
|
1867
1865
|
"`"
|
|
1868
1866
|
]);
|
|
1869
|
-
}, Ne = "embeddedYaml",
|
|
1870
|
-
[
|
|
1867
|
+
}, Ne = "embeddedYaml", bo = ["yaml", "yml"], fo = D(Ne), Zn = A(Ne), ei = T(Ne), yo = {
|
|
1868
|
+
[fo]: {
|
|
1871
1869
|
category: "Embed",
|
|
1872
1870
|
type: "string",
|
|
1873
1871
|
array: !0,
|
|
1874
|
-
default: [{ value: [...
|
|
1872
|
+
default: [{ value: [...bo] }],
|
|
1875
1873
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded YAML language.",
|
|
1876
1874
|
deprecated: `Please use \`${Zn}\` or \`${ei}\`.`
|
|
1877
1875
|
},
|
|
@@ -1889,46 +1887,46 @@ const mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1889
1887
|
default: [{ value: [_] }],
|
|
1890
1888
|
description: "Tags that make their subsequent template literals be identified as embedded YAML language."
|
|
1891
1889
|
}
|
|
1892
|
-
},
|
|
1890
|
+
}, _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1893
1891
|
__proto__: null,
|
|
1894
|
-
embedder:
|
|
1892
|
+
embedder: Eo,
|
|
1895
1893
|
language: Ne,
|
|
1896
|
-
options:
|
|
1897
|
-
}, Symbol.toStringTag, { value: "Module" })), me = [], di = {}, li = {}, ci = {},
|
|
1898
|
-
"./css/index.ts":
|
|
1899
|
-
"./es/index.ts":
|
|
1900
|
-
"./glsl/index.ts":
|
|
1901
|
-
"./graphql/index.ts":
|
|
1902
|
-
"./html/index.ts":
|
|
1903
|
-
"./ini/index.ts":
|
|
1904
|
-
"./java/index.ts":
|
|
1905
|
-
"./json/index.ts":
|
|
1906
|
-
"./jsonata/index.ts":
|
|
1907
|
-
"./latex/index.ts":
|
|
1908
|
-
"./markdown/index.ts":
|
|
1909
|
-
"./nginx/index.ts":
|
|
1910
|
-
"./noop/index.ts":
|
|
1911
|
-
"./pegjs/index.ts":
|
|
1912
|
-
"./php/index.ts":
|
|
1913
|
-
"./prisma/index.ts":
|
|
1914
|
-
"./properties/index.ts":
|
|
1915
|
-
"./pug/index.ts":
|
|
1916
|
-
"./ruby/index.ts":
|
|
1917
|
-
"./sh/index.ts":
|
|
1918
|
-
"./sql/index.ts":
|
|
1919
|
-
"./toml/index.ts":
|
|
1920
|
-
"./ts/index.ts":
|
|
1921
|
-
"./xml/index.ts":
|
|
1922
|
-
"./yaml/index.ts":
|
|
1894
|
+
options: yo
|
|
1895
|
+
}, Symbol.toStringTag, { value: "Module" })), me = [], di = {}, li = {}, ci = {}, $o = /* @__PURE__ */ Object.assign({
|
|
1896
|
+
"./css/index.ts": Ui,
|
|
1897
|
+
"./es/index.ts": Ki,
|
|
1898
|
+
"./glsl/index.ts": Yi,
|
|
1899
|
+
"./graphql/index.ts": ns,
|
|
1900
|
+
"./html/index.ts": cs,
|
|
1901
|
+
"./ini/index.ts": hs,
|
|
1902
|
+
"./java/index.ts": _s,
|
|
1903
|
+
"./json/index.ts": ks,
|
|
1904
|
+
"./jsonata/index.ts": xs,
|
|
1905
|
+
"./latex/index.ts": js,
|
|
1906
|
+
"./markdown/index.ts": Hs,
|
|
1907
|
+
"./nginx/index.ts": Zs,
|
|
1908
|
+
"./noop/index.ts": nr,
|
|
1909
|
+
"./pegjs/index.ts": ar,
|
|
1910
|
+
"./php/index.ts": pr,
|
|
1911
|
+
"./prisma/index.ts": br,
|
|
1912
|
+
"./properties/index.ts": vr,
|
|
1913
|
+
"./pug/index.ts": Sr,
|
|
1914
|
+
"./ruby/index.ts": Ir,
|
|
1915
|
+
"./sh/index.ts": Ur,
|
|
1916
|
+
"./sql/index.ts": Hr,
|
|
1917
|
+
"./toml/index.ts": Zr,
|
|
1918
|
+
"./ts/index.ts": oo,
|
|
1919
|
+
"./xml/index.ts": ho,
|
|
1920
|
+
"./yaml/index.ts": _o
|
|
1923
1921
|
});
|
|
1924
|
-
for (const { language: e, parser: t, embedder: n, options: r } of Object.values(
|
|
1925
|
-
|
|
1926
|
-
const
|
|
1922
|
+
for (const { language: e, parser: t, embedder: n, options: r } of Object.values($o))
|
|
1923
|
+
Ni(me, e, ce), t && (di[e] = t), n && (li[e] = n), Object.assign(ci, r);
|
|
1924
|
+
const vo = "noEmbeddedIdentificationByComment", Do = "noEmbeddedIdentificationByTag", To = "preserveEmbeddedExteriorWhitespaces", Mo = "noEmbeddedMultiLineIndentation", Ao = "embeddedOverrides", sa = {
|
|
1927
1925
|
...ci,
|
|
1928
1926
|
/**
|
|
1929
1927
|
* @deprecated Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore.
|
|
1930
1928
|
*/
|
|
1931
|
-
[
|
|
1929
|
+
[vo]: {
|
|
1932
1930
|
category: "Embed",
|
|
1933
1931
|
type: "string",
|
|
1934
1932
|
array: !0,
|
|
@@ -1939,7 +1937,7 @@ const $o = "noEmbeddedIdentificationByComment", vo = "noEmbeddedIdentificationBy
|
|
|
1939
1937
|
/**
|
|
1940
1938
|
* @deprecated Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore.
|
|
1941
1939
|
*/
|
|
1942
|
-
[
|
|
1940
|
+
[Do]: {
|
|
1943
1941
|
category: "Embed",
|
|
1944
1942
|
type: "string",
|
|
1945
1943
|
array: !0,
|
|
@@ -1947,38 +1945,38 @@ const $o = "noEmbeddedIdentificationByComment", vo = "noEmbeddedIdentificationBy
|
|
|
1947
1945
|
description: "Turns off `` tag`...` `` tag-based embedded language identification for the specified identifiers.",
|
|
1948
1946
|
deprecated: "Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore."
|
|
1949
1947
|
},
|
|
1950
|
-
[
|
|
1948
|
+
[To]: {
|
|
1951
1949
|
category: "Embed",
|
|
1952
1950
|
type: "string",
|
|
1953
1951
|
array: !0,
|
|
1954
1952
|
default: [{ value: [] }],
|
|
1955
1953
|
description: "Preserves leading and trailing whitespaces in the formatting results for the specified comments or tags."
|
|
1956
1954
|
},
|
|
1957
|
-
[
|
|
1955
|
+
[Mo]: {
|
|
1958
1956
|
category: "Embed",
|
|
1959
1957
|
type: "string",
|
|
1960
1958
|
array: !0,
|
|
1961
1959
|
default: [{ value: [] }],
|
|
1962
1960
|
description: "Turns off auto indentation in the formatting results for the specified comments or tags when they are formatted to span multi lines."
|
|
1963
1961
|
},
|
|
1964
|
-
[
|
|
1962
|
+
[Ao]: {
|
|
1965
1963
|
category: "Embed",
|
|
1966
1964
|
type: "string",
|
|
1967
1965
|
array: !1,
|
|
1968
1966
|
default: void 0,
|
|
1969
1967
|
description: "Option overrides for the specified comments or tags. It should either be a stringified JSON or an absolute filepath to the option overrides file."
|
|
1970
1968
|
}
|
|
1971
|
-
},
|
|
1969
|
+
}, So = {
|
|
1972
1970
|
// parsers from internal
|
|
1973
|
-
...bi.parsers,
|
|
1974
1971
|
...fi.parsers,
|
|
1975
1972
|
...yi.parsers,
|
|
1976
|
-
...$i.parsers,
|
|
1977
1973
|
..._i.parsers,
|
|
1974
|
+
...vi.parsers,
|
|
1975
|
+
...$i.parsers,
|
|
1978
1976
|
// parsers from this plugin
|
|
1979
1977
|
...di
|
|
1980
1978
|
};
|
|
1981
|
-
var
|
|
1979
|
+
var ko = {
|
|
1982
1980
|
isEqual: !0,
|
|
1983
1981
|
isMatchingKey: !0,
|
|
1984
1982
|
isPromise: !0,
|
|
@@ -1987,21 +1985,21 @@ var So = {
|
|
|
1987
1985
|
onCacheChange: !0,
|
|
1988
1986
|
onCacheHit: !0,
|
|
1989
1987
|
transformKey: !0
|
|
1990
|
-
},
|
|
1988
|
+
}, Lo = Array.prototype.slice;
|
|
1991
1989
|
function Ee(e) {
|
|
1992
1990
|
var t = e.length;
|
|
1993
|
-
return t ? t === 1 ? [e[0]] : t === 2 ? [e[0], e[1]] : t === 3 ? [e[0], e[1], e[2]] :
|
|
1991
|
+
return t ? t === 1 ? [e[0]] : t === 2 ? [e[0], e[1]] : t === 3 ? [e[0], e[1], e[2]] : Lo.call(e, 0) : [];
|
|
1994
1992
|
}
|
|
1995
|
-
function
|
|
1993
|
+
function Go(e) {
|
|
1996
1994
|
var t = {};
|
|
1997
1995
|
for (var n in e)
|
|
1998
|
-
|
|
1996
|
+
ko[n] || (t[n] = e[n]);
|
|
1999
1997
|
return t;
|
|
2000
1998
|
}
|
|
2001
|
-
function
|
|
1999
|
+
function No(e) {
|
|
2002
2000
|
return typeof e == "function" && e.isMemoized;
|
|
2003
2001
|
}
|
|
2004
|
-
function
|
|
2002
|
+
function Oo(e, t) {
|
|
2005
2003
|
return e === t || e !== e && t !== t;
|
|
2006
2004
|
}
|
|
2007
2005
|
function ti(e, t) {
|
|
@@ -2012,7 +2010,7 @@ function ti(e, t) {
|
|
|
2012
2010
|
n[r] = t[r];
|
|
2013
2011
|
return n;
|
|
2014
2012
|
}
|
|
2015
|
-
var
|
|
2013
|
+
var xo = (
|
|
2016
2014
|
/** @class */
|
|
2017
2015
|
function() {
|
|
2018
2016
|
function e(t) {
|
|
@@ -2045,107 +2043,107 @@ var Oo = (
|
|
|
2045
2043
|
enumerable: !1,
|
|
2046
2044
|
configurable: !0
|
|
2047
2045
|
}), e.prototype._getKeyIndexFromMatchingKey = function(t) {
|
|
2048
|
-
var n = this.options, r = n.isMatchingKey,
|
|
2049
|
-
if (!
|
|
2046
|
+
var n = this.options, r = n.isMatchingKey, s = n.maxSize, o = this.keys, i = o.length;
|
|
2047
|
+
if (!i)
|
|
2050
2048
|
return -1;
|
|
2051
|
-
if (r(
|
|
2049
|
+
if (r(o[0], t))
|
|
2052
2050
|
return 0;
|
|
2053
|
-
if (
|
|
2054
|
-
for (var l = 1; l <
|
|
2055
|
-
if (r(
|
|
2051
|
+
if (s > 1) {
|
|
2052
|
+
for (var l = 1; l < i; l++)
|
|
2053
|
+
if (r(o[l], t))
|
|
2056
2054
|
return l;
|
|
2057
2055
|
}
|
|
2058
2056
|
return -1;
|
|
2059
2057
|
}, e.prototype._getKeyIndexForMany = function(t) {
|
|
2060
|
-
var n = this.options.isEqual, r = this.keys,
|
|
2061
|
-
if (!
|
|
2058
|
+
var n = this.options.isEqual, r = this.keys, s = r.length;
|
|
2059
|
+
if (!s)
|
|
2062
2060
|
return -1;
|
|
2063
|
-
if (
|
|
2061
|
+
if (s === 1)
|
|
2064
2062
|
return this._getKeyIndexForSingle(t);
|
|
2065
|
-
var
|
|
2066
|
-
if (
|
|
2067
|
-
for (var u = 0; u <
|
|
2068
|
-
if (
|
|
2069
|
-
for (l = 0; l <
|
|
2063
|
+
var o = t.length, i, l;
|
|
2064
|
+
if (o > 1) {
|
|
2065
|
+
for (var u = 0; u < s; u++)
|
|
2066
|
+
if (i = r[u], i.length === o) {
|
|
2067
|
+
for (l = 0; l < o && n(i[l], t[l]); l++)
|
|
2070
2068
|
;
|
|
2071
|
-
if (l ===
|
|
2069
|
+
if (l === o)
|
|
2072
2070
|
return u;
|
|
2073
2071
|
}
|
|
2074
2072
|
} else
|
|
2075
|
-
for (var u = 0; u <
|
|
2076
|
-
if (
|
|
2073
|
+
for (var u = 0; u < s; u++)
|
|
2074
|
+
if (i = r[u], i.length === o && n(i[0], t[0]))
|
|
2077
2075
|
return u;
|
|
2078
2076
|
return -1;
|
|
2079
2077
|
}, e.prototype._getKeyIndexForSingle = function(t) {
|
|
2080
2078
|
var n = this.keys;
|
|
2081
2079
|
if (!n.length)
|
|
2082
2080
|
return -1;
|
|
2083
|
-
var r = n[0],
|
|
2084
|
-
if (t.length !==
|
|
2081
|
+
var r = n[0], s = r.length;
|
|
2082
|
+
if (t.length !== s)
|
|
2085
2083
|
return -1;
|
|
2086
|
-
var
|
|
2087
|
-
if (
|
|
2088
|
-
for (var
|
|
2089
|
-
if (!
|
|
2084
|
+
var o = this.options.isEqual;
|
|
2085
|
+
if (s > 1) {
|
|
2086
|
+
for (var i = 0; i < s; i++)
|
|
2087
|
+
if (!o(r[i], t[i]))
|
|
2090
2088
|
return -1;
|
|
2091
2089
|
return 0;
|
|
2092
2090
|
}
|
|
2093
|
-
return
|
|
2091
|
+
return o(r[0], t[0]) ? 0 : -1;
|
|
2094
2092
|
}, e.prototype.orderByLru = function(t, n, r) {
|
|
2095
|
-
for (var
|
|
2096
|
-
|
|
2097
|
-
|
|
2093
|
+
for (var s = this.keys, o = this.values, i = s.length, l = r; l--; )
|
|
2094
|
+
s[l + 1] = s[l], o[l + 1] = o[l];
|
|
2095
|
+
s[0] = t, o[0] = n;
|
|
2098
2096
|
var u = this.options.maxSize;
|
|
2099
|
-
|
|
2097
|
+
i === u && r === i ? (s.pop(), o.pop()) : r >= u && (s.length = o.length = u);
|
|
2100
2098
|
}, e.prototype.updateAsyncCache = function(t) {
|
|
2101
|
-
var n = this, r = this.options,
|
|
2099
|
+
var n = this, r = this.options, s = r.onCacheChange, o = r.onCacheHit, i = this.keys[0], l = this.values[0];
|
|
2102
2100
|
this.values[0] = l.then(function(u) {
|
|
2103
|
-
return n.shouldUpdateOnHit &&
|
|
2101
|
+
return n.shouldUpdateOnHit && o(n, n.options, t), n.shouldUpdateOnChange && s(n, n.options, t), u;
|
|
2104
2102
|
}, function(u) {
|
|
2105
|
-
var E = n.getKeyIndex(
|
|
2103
|
+
var E = n.getKeyIndex(i);
|
|
2106
2104
|
throw E !== -1 && (n.keys.splice(E, 1), n.values.splice(E, 1)), u;
|
|
2107
2105
|
});
|
|
2108
2106
|
}, e;
|
|
2109
2107
|
}()
|
|
2110
2108
|
);
|
|
2111
2109
|
function ui(e, t) {
|
|
2112
|
-
if (t === void 0 && (t = {}),
|
|
2110
|
+
if (t === void 0 && (t = {}), No(e))
|
|
2113
2111
|
return ui(e.fn, ti(e.options, t));
|
|
2114
2112
|
if (typeof e != "function")
|
|
2115
2113
|
throw new TypeError("You must pass a function to `memoize`.");
|
|
2116
|
-
var n = t.isEqual, r = n === void 0 ?
|
|
2114
|
+
var n = t.isEqual, r = n === void 0 ? Oo : n, s = t.isMatchingKey, o = t.isPromise, i = o === void 0 ? !1 : o, l = t.maxSize, u = l === void 0 ? 1 : l, E = t.onCacheAdd, d = t.onCacheChange, c = t.onCacheHit, p = t.transformKey, f = ti({
|
|
2117
2115
|
isEqual: r,
|
|
2118
|
-
isMatchingKey:
|
|
2119
|
-
isPromise:
|
|
2116
|
+
isMatchingKey: s,
|
|
2117
|
+
isPromise: i,
|
|
2120
2118
|
maxSize: u,
|
|
2121
2119
|
onCacheAdd: E,
|
|
2122
2120
|
onCacheChange: d,
|
|
2123
2121
|
onCacheHit: c,
|
|
2124
2122
|
transformKey: p
|
|
2125
|
-
},
|
|
2123
|
+
}, Go(t)), b = new xo(f), $ = b.keys, a = b.values, h = b.canTransformKey, v = b.shouldCloneArguments, m = b.shouldUpdateOnAdd, g = b.shouldUpdateOnChange, y = b.shouldUpdateOnHit, G = function() {
|
|
2126
2124
|
var N = v ? Ee(arguments) : arguments;
|
|
2127
2125
|
h && (N = p(N));
|
|
2128
2126
|
var x = $.length ? b.getKeyIndex(N) : -1;
|
|
2129
2127
|
if (x !== -1)
|
|
2130
|
-
y && c(b, f, G), x && (b.orderByLru($[x],
|
|
2128
|
+
y && c(b, f, G), x && (b.orderByLru($[x], a[x], x), g && d(b, f, G));
|
|
2131
2129
|
else {
|
|
2132
|
-
var
|
|
2133
|
-
b.orderByLru(
|
|
2130
|
+
var Ei = e.apply(this, arguments), bi = v ? N : Ee(arguments);
|
|
2131
|
+
b.orderByLru(bi, Ei, $.length), i && b.updateAsyncCache(G), m && E(b, f, G), g && d(b, f, G);
|
|
2134
2132
|
}
|
|
2135
|
-
return
|
|
2133
|
+
return a[0];
|
|
2136
2134
|
};
|
|
2137
2135
|
return G.cache = b, G.fn = e, G.isMemoized = !0, G.options = f, G;
|
|
2138
2136
|
}
|
|
2139
|
-
const
|
|
2137
|
+
const Io = /("(?:\\?[^])*?")|(\/\/.*)|(\/\*[^]*?\*\/)/g, Po = /("(?:\\?[^])*?")|(,\s*)(?=]|})/g, Pe = {
|
|
2140
2138
|
parse: (e) => {
|
|
2141
2139
|
e = String(e);
|
|
2142
2140
|
try {
|
|
2143
2141
|
return JSON.parse(e);
|
|
2144
2142
|
} catch {
|
|
2145
|
-
return JSON.parse(e.replace(
|
|
2143
|
+
return JSON.parse(e.replace(Io, "$1").replace(Po, "$1"));
|
|
2146
2144
|
}
|
|
2147
2145
|
}
|
|
2148
|
-
}, { label:
|
|
2146
|
+
}, { label: Bo } = M;
|
|
2149
2147
|
async function ni(e) {
|
|
2150
2148
|
try {
|
|
2151
2149
|
const { readFile: t } = await import("node:fs/promises"), n = await t(e, { encoding: "utf-8" });
|
|
@@ -2153,52 +2151,52 @@ async function ni(e) {
|
|
|
2153
2151
|
} catch {
|
|
2154
2152
|
}
|
|
2155
2153
|
}
|
|
2156
|
-
const
|
|
2154
|
+
const qo = /* @__PURE__ */ new URL(
|
|
2157
2155
|
`data:text/javascript,${encodeURIComponent('import{pathToFileURL as o}from"node:url";import{parentPort as t,workerData as a}from"node:worker_threads";const s=async({absolutePath:r})=>{try{const e=await import(o(r).href);t?.postMessage(e.embeddedOverrides??e.default??void 0)}catch{t?.postMessage(void 0)}};s(a);')}`
|
|
2158
|
-
),
|
|
2156
|
+
), jo = /* @__PURE__ */ new URL(
|
|
2159
2157
|
`data:text/javascript,${encodeURIComponent('import{register as a}from"node:module";import{pathToFileURL as s}from"node:url";import{parentPort as t,workerData as i}from"node:worker_threads";const d=async({absolutePath:r,importMetaUrl:o})=>{a("tsx/esm",{parentURL:o,data:!0});try{const e=await import(s(r).href);t?.postMessage(e.embeddedOverrides??e.default??void 0)}catch{t?.postMessage(void 0)}};d(i);')}`
|
|
2160
2158
|
);
|
|
2161
|
-
async function
|
|
2159
|
+
async function Uo(e) {
|
|
2162
2160
|
const { Worker: t } = await import("node:worker_threads");
|
|
2163
2161
|
return new Promise((n) => {
|
|
2164
|
-
const r = new t(
|
|
2162
|
+
const r = new t(qo, {
|
|
2165
2163
|
workerData: {
|
|
2166
2164
|
absolutePath: e
|
|
2167
2165
|
}
|
|
2168
2166
|
});
|
|
2169
|
-
r.once("message", (
|
|
2170
|
-
n(
|
|
2171
|
-
}), r.once("error", (
|
|
2172
|
-
console.error(
|
|
2167
|
+
r.once("message", (s) => {
|
|
2168
|
+
n(s);
|
|
2169
|
+
}), r.once("error", (s) => {
|
|
2170
|
+
console.error(s), n(void 0);
|
|
2173
2171
|
});
|
|
2174
2172
|
});
|
|
2175
2173
|
}
|
|
2176
|
-
async function
|
|
2174
|
+
async function Ro(e) {
|
|
2177
2175
|
const { Worker: t } = await import("node:worker_threads");
|
|
2178
2176
|
return new Promise((n) => {
|
|
2179
|
-
const r = new t(
|
|
2177
|
+
const r = new t(jo, {
|
|
2180
2178
|
workerData: {
|
|
2181
2179
|
absolutePath: e,
|
|
2182
2180
|
importMetaUrl: import.meta.url
|
|
2183
2181
|
}
|
|
2184
2182
|
});
|
|
2185
|
-
r.once("message", (
|
|
2186
|
-
n(
|
|
2187
|
-
}), r.once("error", (
|
|
2188
|
-
console.error(
|
|
2183
|
+
r.once("message", (s) => {
|
|
2184
|
+
n(s);
|
|
2185
|
+
}), r.once("error", (s) => {
|
|
2186
|
+
console.error(s), n(void 0);
|
|
2189
2187
|
});
|
|
2190
2188
|
});
|
|
2191
2189
|
}
|
|
2192
|
-
const
|
|
2190
|
+
const Co = ui(
|
|
2193
2191
|
async (e, t) => {
|
|
2194
|
-
const { isAbsolute: n, dirname: r, resolve:
|
|
2192
|
+
const { isAbsolute: n, dirname: r, resolve: s } = await import("node:path");
|
|
2195
2193
|
if (n(e))
|
|
2196
2194
|
return e;
|
|
2197
|
-
const
|
|
2198
|
-
let
|
|
2199
|
-
return typeof
|
|
2195
|
+
const o = await Ti(t);
|
|
2196
|
+
let i;
|
|
2197
|
+
return typeof o != "string" ? i = process.env.PWD ?? process.cwd() : i = r(o), s(i, e);
|
|
2200
2198
|
}
|
|
2201
|
-
),
|
|
2199
|
+
), wo = async (e, t) => {
|
|
2202
2200
|
let n;
|
|
2203
2201
|
try {
|
|
2204
2202
|
n = (await import("node:path")).extname(
|
|
@@ -2212,35 +2210,35 @@ const Ro = ui(
|
|
|
2212
2210
|
return;
|
|
2213
2211
|
}
|
|
2214
2212
|
}
|
|
2215
|
-
const r =
|
|
2213
|
+
const r = Co(
|
|
2216
2214
|
e,
|
|
2217
2215
|
t
|
|
2218
2216
|
);
|
|
2219
2217
|
if (n === ".json" || n === ".jsonc") {
|
|
2220
|
-
const
|
|
2221
|
-
if (
|
|
2222
|
-
return
|
|
2223
|
-
console.error(`Failed to parse the json file: ${
|
|
2218
|
+
const s = await r, o = await ni(s);
|
|
2219
|
+
if (o !== void 0)
|
|
2220
|
+
return o;
|
|
2221
|
+
console.error(`Failed to parse the json file: ${s}`);
|
|
2224
2222
|
return;
|
|
2225
2223
|
}
|
|
2226
2224
|
if (n === ".mjs" || n === ".cjs" || n === ".js") {
|
|
2227
|
-
const
|
|
2228
|
-
if (
|
|
2229
|
-
return
|
|
2230
|
-
console.error(`Failed to parse the js module file: ${
|
|
2225
|
+
const s = await r, o = await Uo(s);
|
|
2226
|
+
if (o !== void 0)
|
|
2227
|
+
return o;
|
|
2228
|
+
console.error(`Failed to parse the js module file: ${s}`);
|
|
2231
2229
|
return;
|
|
2232
2230
|
}
|
|
2233
2231
|
if (n === ".mts" || n === ".cts" || n === ".ts") {
|
|
2234
|
-
const
|
|
2235
|
-
if (
|
|
2236
|
-
return
|
|
2237
|
-
console.error(`Failed to parse the ts module file: ${
|
|
2232
|
+
const s = await r, o = await Ro(s);
|
|
2233
|
+
if (o !== void 0)
|
|
2234
|
+
return o;
|
|
2235
|
+
console.error(`Failed to parse the ts module file: ${s}`);
|
|
2238
2236
|
return;
|
|
2239
2237
|
}
|
|
2240
2238
|
if (n === "") {
|
|
2241
|
-
const
|
|
2242
|
-
if (
|
|
2243
|
-
return
|
|
2239
|
+
const s = await r, o = await ni(s);
|
|
2240
|
+
if (o !== void 0)
|
|
2241
|
+
return o;
|
|
2244
2242
|
}
|
|
2245
2243
|
try {
|
|
2246
2244
|
return Pe.parse(e);
|
|
@@ -2248,29 +2246,32 @@ const Ro = ui(
|
|
|
2248
2246
|
console.error("Failed to parse embeddedOverrides as a json object");
|
|
2249
2247
|
}
|
|
2250
2248
|
};
|
|
2251
|
-
async function
|
|
2249
|
+
async function Fo(e, {
|
|
2252
2250
|
commentOrTag: t,
|
|
2253
2251
|
kind: n,
|
|
2254
2252
|
filepath: r
|
|
2255
2253
|
}) {
|
|
2256
2254
|
if (e === void 0)
|
|
2257
2255
|
return;
|
|
2258
|
-
const
|
|
2256
|
+
const s = await wo(
|
|
2259
2257
|
e,
|
|
2260
2258
|
r
|
|
2261
2259
|
);
|
|
2262
|
-
if (
|
|
2260
|
+
if (s !== void 0)
|
|
2263
2261
|
for (const {
|
|
2264
|
-
[`${n}s`]:
|
|
2265
|
-
identifiers:
|
|
2262
|
+
[`${n}s`]: o,
|
|
2263
|
+
identifiers: i,
|
|
2266
2264
|
options: l
|
|
2267
|
-
} of
|
|
2268
|
-
const u =
|
|
2269
|
-
if (u.length === 0 &&
|
|
2265
|
+
} of s) {
|
|
2266
|
+
const u = o ?? [];
|
|
2267
|
+
if (u.length === 0 && i?.includes(t) || u.includes(t))
|
|
2270
2268
|
return l;
|
|
2271
2269
|
}
|
|
2272
2270
|
}
|
|
2273
|
-
|
|
2271
|
+
function* pi(e) {
|
|
2272
|
+
yield e, e.type === "CallExpression" && (yield* pi(e.callee));
|
|
2273
|
+
}
|
|
2274
|
+
const Wo = /* @__PURE__ */ (() => {
|
|
2274
2275
|
const e = /* @__PURE__ */ new Set([
|
|
2275
2276
|
"start",
|
|
2276
2277
|
"end",
|
|
@@ -2281,26 +2282,31 @@ const Fo = /* @__PURE__ */ (() => {
|
|
|
2281
2282
|
"decorators"
|
|
2282
2283
|
]);
|
|
2283
2284
|
return (t, n, r) => {
|
|
2284
|
-
let
|
|
2285
|
+
let s;
|
|
2285
2286
|
try {
|
|
2286
|
-
const
|
|
2287
|
-
if (
|
|
2287
|
+
const i = r(`${n}\`\``);
|
|
2288
|
+
if (i instanceof Promise)
|
|
2288
2289
|
throw new TypeError("Async parse function hasn't been supported yet.");
|
|
2289
|
-
|
|
2290
|
+
s = i;
|
|
2290
2291
|
} catch {
|
|
2291
2292
|
return !1;
|
|
2292
2293
|
}
|
|
2293
|
-
if (
|
|
2294
|
+
if (s.type === "File" && (s = s.program), !(s.type === "Program" && s.body[0]?.type === "ExpressionStatement"))
|
|
2294
2295
|
return !1;
|
|
2295
|
-
const
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2296
|
+
const o = s.body[0]?.expression;
|
|
2297
|
+
if (o?.type !== "TaggedTemplateExpression")
|
|
2298
|
+
return !1;
|
|
2299
|
+
for (const i of pi(t))
|
|
2300
|
+
if (mi(
|
|
2301
|
+
i,
|
|
2302
|
+
o.tag,
|
|
2303
|
+
e
|
|
2304
|
+
))
|
|
2305
|
+
return !0;
|
|
2306
|
+
return !1;
|
|
2301
2307
|
};
|
|
2302
2308
|
})();
|
|
2303
|
-
function
|
|
2309
|
+
function zo({
|
|
2304
2310
|
node: e,
|
|
2305
2311
|
parent: t
|
|
2306
2312
|
}) {
|
|
@@ -2317,64 +2323,64 @@ function Wo({
|
|
|
2317
2323
|
// babel, babel-flow, babel-ts
|
|
2318
2324
|
].includes(r.type) || !r.leading)
|
|
2319
2325
|
return;
|
|
2320
|
-
const
|
|
2321
|
-
if (
|
|
2322
|
-
return
|
|
2326
|
+
const s = r.value;
|
|
2327
|
+
if (s.length > 1 && s.startsWith(" ") && s.endsWith(" "))
|
|
2328
|
+
return s.slice(1, -1);
|
|
2323
2329
|
}
|
|
2324
|
-
function
|
|
2330
|
+
function Ko({
|
|
2325
2331
|
parent: e
|
|
2326
2332
|
}) {
|
|
2327
2333
|
if (e?.type === "TaggedTemplateExpression")
|
|
2328
2334
|
return e.tag.type === "Identifier" ? e.tag.name : e.tag;
|
|
2329
2335
|
}
|
|
2330
|
-
function
|
|
2336
|
+
function Jo(e, t) {
|
|
2331
2337
|
return e.noEmbeddedIdentificationByComment?.includes(t) ?? !1 ? function* (r) {
|
|
2332
2338
|
} : function* (r) {
|
|
2333
|
-
const
|
|
2334
|
-
|
|
2339
|
+
const s = e[A(r)] ?? [_];
|
|
2340
|
+
s[0] === _ ? yield* e[D(r)] ?? [] : yield* s ?? [];
|
|
2335
2341
|
};
|
|
2336
2342
|
}
|
|
2337
2343
|
function ii(e, t) {
|
|
2338
2344
|
return typeof t == "string" ? e.noEmbeddedIdentificationByTag?.includes(t) ?? !1 ? function* (r) {
|
|
2339
2345
|
} : function* (r) {
|
|
2340
|
-
const
|
|
2346
|
+
const s = e[T(r)] ?? [
|
|
2341
2347
|
_
|
|
2342
2348
|
];
|
|
2343
|
-
|
|
2349
|
+
s[0] === _ ? yield* e[D(r)] ?? [] : yield* s ?? [];
|
|
2344
2350
|
} : function* (n) {
|
|
2345
2351
|
const r = e[T(n)] ?? [
|
|
2346
2352
|
_
|
|
2347
2353
|
];
|
|
2348
2354
|
if (r[0] === _) {
|
|
2349
|
-
const { noEmbeddedIdentificationByTag:
|
|
2350
|
-
for (const
|
|
2351
|
-
|
|
2355
|
+
const { noEmbeddedIdentificationByTag: s } = e;
|
|
2356
|
+
for (const o of e[D(n)] ?? [])
|
|
2357
|
+
s?.includes(o) || (yield o);
|
|
2352
2358
|
} else
|
|
2353
2359
|
yield* r;
|
|
2354
2360
|
};
|
|
2355
2361
|
}
|
|
2356
|
-
function xe(e, t, n, r,
|
|
2357
|
-
const
|
|
2358
|
-
if (!
|
|
2362
|
+
function xe(e, t, n, r, s) {
|
|
2363
|
+
const o = li[t];
|
|
2364
|
+
if (!o)
|
|
2359
2365
|
return null;
|
|
2360
2366
|
if (e.quasis.length === 1 && e.quasis[0]?.value.raw.trim() === "")
|
|
2361
2367
|
return "``";
|
|
2362
|
-
const
|
|
2363
|
-
|
|
2368
|
+
const i = Fo(
|
|
2369
|
+
s.embeddedOverrides,
|
|
2364
2370
|
{
|
|
2365
2371
|
commentOrTag: n,
|
|
2366
2372
|
kind: r,
|
|
2367
|
-
filepath:
|
|
2373
|
+
filepath: s.filepath
|
|
2368
2374
|
}
|
|
2369
2375
|
);
|
|
2370
2376
|
return async (...l) => {
|
|
2371
2377
|
try {
|
|
2372
|
-
const u = await
|
|
2378
|
+
const u = await o(...l, {
|
|
2373
2379
|
commentOrTag: n,
|
|
2374
2380
|
kind: r,
|
|
2375
|
-
embeddedOverrideOptions: await
|
|
2381
|
+
embeddedOverrideOptions: await i
|
|
2376
2382
|
});
|
|
2377
|
-
return
|
|
2383
|
+
return Bo(
|
|
2378
2384
|
{
|
|
2379
2385
|
embed: !0,
|
|
2380
2386
|
...u.label
|
|
@@ -2386,38 +2392,38 @@ function xe(e, t, n, r, i) {
|
|
|
2386
2392
|
}
|
|
2387
2393
|
};
|
|
2388
2394
|
}
|
|
2389
|
-
function
|
|
2390
|
-
return Object.is(e, t) ? !0 : e === null || t === null ? !1 : Array.isArray(e) ?
|
|
2395
|
+
function gi(e, t, n) {
|
|
2396
|
+
return Object.is(e, t) ? !0 : e === null || t === null ? !1 : Array.isArray(e) ? Ho(e, t, n) : typeof e == "object" ? mi(e, t, n) : !1;
|
|
2391
2397
|
}
|
|
2392
|
-
function
|
|
2398
|
+
function Ho(e, t, n) {
|
|
2393
2399
|
const r = e.length;
|
|
2394
2400
|
if (r !== t.length)
|
|
2395
2401
|
return !1;
|
|
2396
|
-
for (let
|
|
2397
|
-
if (!
|
|
2402
|
+
for (let s = 0; s < r; s++)
|
|
2403
|
+
if (!gi(e[s], t[s], n))
|
|
2398
2404
|
return !1;
|
|
2399
2405
|
return !0;
|
|
2400
2406
|
}
|
|
2401
|
-
function
|
|
2407
|
+
function mi(e, t, n) {
|
|
2402
2408
|
for (const r of Object.keys(e))
|
|
2403
|
-
if (!n?.has(r) && !(Object.prototype.hasOwnProperty.call(t, r) &&
|
|
2409
|
+
if (!n?.has(r) && !(Object.prototype.hasOwnProperty.call(t, r) && gi(e[r], t[r], n)))
|
|
2404
2410
|
return !1;
|
|
2405
2411
|
return !0;
|
|
2406
2412
|
}
|
|
2407
|
-
const { estree:
|
|
2413
|
+
const { estree: hi } = Di, { embed: Ie } = hi, Xo = (e, t) => {
|
|
2408
2414
|
const { node: n } = e;
|
|
2409
|
-
if (n.type !== "TemplateLiteral" || n.quasis.some(({ value: { cooked:
|
|
2415
|
+
if (n.type !== "TemplateLiteral" || n.quasis.some(({ value: { cooked: o } }) => o === null))
|
|
2410
2416
|
return null;
|
|
2411
|
-
const r =
|
|
2417
|
+
const r = zo(e);
|
|
2412
2418
|
if (typeof r == "string") {
|
|
2413
|
-
const
|
|
2419
|
+
const o = Jo(
|
|
2414
2420
|
t,
|
|
2415
2421
|
r
|
|
2416
2422
|
);
|
|
2417
|
-
for (const
|
|
2423
|
+
for (const i of me) {
|
|
2418
2424
|
let l = !1;
|
|
2419
|
-
for (const u of
|
|
2420
|
-
|
|
2425
|
+
for (const u of o(
|
|
2426
|
+
i
|
|
2421
2427
|
))
|
|
2422
2428
|
if (r === u) {
|
|
2423
2429
|
l = !0;
|
|
@@ -2426,7 +2432,7 @@ const { estree: mi } = vi, { embed: Ie } = mi, Ho = (e, t) => {
|
|
|
2426
2432
|
if (l)
|
|
2427
2433
|
return xe(
|
|
2428
2434
|
n,
|
|
2429
|
-
|
|
2435
|
+
i,
|
|
2430
2436
|
r,
|
|
2431
2437
|
"comment",
|
|
2432
2438
|
t
|
|
@@ -2434,30 +2440,30 @@ const { estree: mi } = vi, { embed: Ie } = mi, Ho = (e, t) => {
|
|
|
2434
2440
|
}
|
|
2435
2441
|
return Ie?.(e, t) ?? null;
|
|
2436
2442
|
}
|
|
2437
|
-
const
|
|
2438
|
-
if (typeof
|
|
2439
|
-
const
|
|
2440
|
-
for (const
|
|
2443
|
+
const s = Ko(e);
|
|
2444
|
+
if (typeof s == "string") {
|
|
2445
|
+
const o = ii(t, s);
|
|
2446
|
+
for (const i of me) {
|
|
2441
2447
|
let l = !1;
|
|
2442
|
-
for (const u of
|
|
2443
|
-
if (
|
|
2448
|
+
for (const u of o(i))
|
|
2449
|
+
if (s === u) {
|
|
2444
2450
|
l = !0;
|
|
2445
2451
|
break;
|
|
2446
2452
|
}
|
|
2447
2453
|
if (l)
|
|
2448
|
-
return xe(n,
|
|
2454
|
+
return xe(n, i, s, "tag", t);
|
|
2449
2455
|
}
|
|
2450
2456
|
return Ie?.(e, t) ?? null;
|
|
2451
2457
|
}
|
|
2452
|
-
if (
|
|
2453
|
-
const
|
|
2458
|
+
if (s !== void 0) {
|
|
2459
|
+
const o = (l) => So[t.parser].parse(
|
|
2454
2460
|
l,
|
|
2455
2461
|
t
|
|
2456
|
-
),
|
|
2462
|
+
), i = ii(t);
|
|
2457
2463
|
for (const l of me) {
|
|
2458
2464
|
let u;
|
|
2459
|
-
for (const E of
|
|
2460
|
-
if (
|
|
2465
|
+
for (const E of i(l))
|
|
2466
|
+
if (Wo(s, E, o)) {
|
|
2461
2467
|
u = E;
|
|
2462
2468
|
break;
|
|
2463
2469
|
}
|
|
@@ -2472,14 +2478,14 @@ const { estree: mi } = vi, { embed: Ie } = mi, Ho = (e, t) => {
|
|
|
2472
2478
|
}
|
|
2473
2479
|
}
|
|
2474
2480
|
return Ie?.(e, t) ?? null;
|
|
2475
|
-
},
|
|
2481
|
+
}, ra = {
|
|
2476
2482
|
estree: {
|
|
2477
|
-
...
|
|
2478
|
-
embed:
|
|
2483
|
+
...hi,
|
|
2484
|
+
embed: Xo
|
|
2479
2485
|
}
|
|
2480
2486
|
};
|
|
2481
2487
|
export {
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2488
|
+
sa as options,
|
|
2489
|
+
So as parsers,
|
|
2490
|
+
ra as printers
|
|
2485
2491
|
};
|