prettier-plugin-embed 0.4.9 → 0.4.10
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 +227 -104
- package/dist/embedded/register.d.ts +2 -2
- package/dist/index.js +702 -667
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
import { builders as $, utils as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { printers as
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import { resolveConfigFile as Sn } from "prettier";
|
|
12
|
-
const { group: Ln, indent: kn, softline: fe, hardline: On, lineSuffixBoundary: An } = $, { mapDoc: Mn } = Ut;
|
|
13
|
-
function Pn(e, t) {
|
|
1
|
+
import { builders as $, utils as Wt } from "prettier/doc";
|
|
2
|
+
import fn from "prettier/parser-babel";
|
|
3
|
+
import bn from "prettier/parser-espree";
|
|
4
|
+
import En from "prettier/parser-flow";
|
|
5
|
+
import _n from "prettier/parser-meriyah";
|
|
6
|
+
import yn from "prettier/parser-typescript";
|
|
7
|
+
import { printers as vn } from "prettier/plugins/estree.mjs";
|
|
8
|
+
import { resolveConfigFile as $n } from "prettier";
|
|
9
|
+
const { group: Dn, indent: In, softline: be, hardline: Tn, lineSuffixBoundary: xn } = $, { mapDoc: Sn } = Wt;
|
|
10
|
+
function Ln(e, t) {
|
|
14
11
|
const { node: n } = e;
|
|
15
12
|
let r = t();
|
|
16
|
-
return n?.comments?.length && (r =
|
|
13
|
+
return n?.comments?.length && (r = Dn([In([be, r]), be])), ["${", r, xn, "}"];
|
|
17
14
|
}
|
|
18
15
|
function T(e, t) {
|
|
19
16
|
return e.map(
|
|
20
|
-
(n) =>
|
|
17
|
+
(n) => Ln(n, t),
|
|
21
18
|
"expressions"
|
|
22
19
|
);
|
|
23
20
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
21
|
+
function I(e, t, n, r = !1) {
|
|
22
|
+
return Sn(e, (c) => {
|
|
26
23
|
if (typeof c != "string")
|
|
27
24
|
return c;
|
|
28
|
-
const
|
|
25
|
+
const s = [], d = c.split(t);
|
|
29
26
|
for (let p = 0; p < d.length; p++) {
|
|
30
27
|
let h = d[p];
|
|
31
28
|
if (p % 2 === 0) {
|
|
@@ -34,15 +31,15 @@ function D(e, t, n, r = !1) {
|
|
|
34
31
|
if (h = h.replaceAll(/([\\`]|\${)/g, "\\$1"), r)
|
|
35
32
|
for (const a of h.split(/(\n)/))
|
|
36
33
|
a === `
|
|
37
|
-
` ?
|
|
34
|
+
` ? s.push(Tn) : s.push(a);
|
|
38
35
|
else
|
|
39
|
-
|
|
36
|
+
s.push(h);
|
|
40
37
|
} else {
|
|
41
38
|
const a = Number(h);
|
|
42
|
-
|
|
39
|
+
s.push(n[a]);
|
|
43
40
|
}
|
|
44
41
|
}
|
|
45
|
-
return
|
|
42
|
+
return s;
|
|
46
43
|
});
|
|
47
44
|
}
|
|
48
45
|
function k(e, t, n) {
|
|
@@ -55,19 +52,19 @@ function k(e, t, n) {
|
|
|
55
52
|
`Cannot format embedded language identified by "${n}", because plugin "${e}" is not loaded.`
|
|
56
53
|
);
|
|
57
54
|
}
|
|
58
|
-
function
|
|
55
|
+
function kn(e, t, n) {
|
|
59
56
|
if (t === n) {
|
|
60
57
|
e.unshift(t);
|
|
61
58
|
return;
|
|
62
59
|
}
|
|
63
|
-
let r = 0,
|
|
64
|
-
for (; r <
|
|
65
|
-
const c = r +
|
|
60
|
+
let r = 0, o = e.length;
|
|
61
|
+
for (; r < o; ) {
|
|
62
|
+
const c = r + o >>> 1;
|
|
66
63
|
if (e[c] === n) {
|
|
67
64
|
e.push(t);
|
|
68
65
|
return;
|
|
69
66
|
}
|
|
70
|
-
e[c] < t ? r = c + 1 :
|
|
67
|
+
e[c] < t ? r = c + 1 : o = c;
|
|
71
68
|
}
|
|
72
69
|
e.splice(r, 0, t);
|
|
73
70
|
}
|
|
@@ -81,29 +78,29 @@ const ne = (() => {
|
|
|
81
78
|
};
|
|
82
79
|
})();
|
|
83
80
|
function x(e = "p", t = "") {
|
|
84
|
-
const n = ne(), r = ne(),
|
|
85
|
-
`${
|
|
81
|
+
const n = ne(), r = ne(), o = ie(e), c = ie(t), s = (p) => `${e}${n}${p}${r}${t}`, d = new RegExp(
|
|
82
|
+
`${o}${n}(\\d+)${r}${c}`,
|
|
86
83
|
"ig"
|
|
87
84
|
);
|
|
88
85
|
return {
|
|
89
|
-
createPlaceholder:
|
|
86
|
+
createPlaceholder: s,
|
|
90
87
|
placeholderRegex: d
|
|
91
88
|
};
|
|
92
89
|
}
|
|
93
90
|
function ie(e) {
|
|
94
91
|
return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
95
92
|
}
|
|
96
|
-
function
|
|
93
|
+
function D(e) {
|
|
97
94
|
return `${e}Identifiers`;
|
|
98
95
|
}
|
|
99
|
-
function
|
|
96
|
+
function On(e) {
|
|
100
97
|
return `${e}Plugin`;
|
|
101
98
|
}
|
|
102
99
|
function O(e) {
|
|
103
100
|
return `${e}Parser`;
|
|
104
101
|
}
|
|
105
|
-
const { line:
|
|
106
|
-
const
|
|
102
|
+
const { line: Ee, group: A, indent: _e, softline: ye } = $, Mn = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
103
|
+
const s = {
|
|
107
104
|
...r,
|
|
108
105
|
...c
|
|
109
106
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x("@p"), a = d.quasis.map(
|
|
@@ -112,49 +109,49 @@ const { line: be, group: M, indent: Ee, softline: _e } = $, Rn = async (e, t, n,
|
|
|
112
109
|
l.length,
|
|
113
110
|
-u.length || void 0
|
|
114
111
|
), b = T(n, t), y = await e(E, {
|
|
115
|
-
...
|
|
116
|
-
parser:
|
|
117
|
-
}), i =
|
|
118
|
-
if (
|
|
119
|
-
return
|
|
112
|
+
...s,
|
|
113
|
+
parser: s.embeddedCssParser ?? "scss"
|
|
114
|
+
}), i = I(y, h, b);
|
|
115
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
116
|
+
return A([
|
|
120
117
|
"`",
|
|
121
118
|
l,
|
|
122
|
-
|
|
119
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [A(i)] : _e([A(i)]),
|
|
123
120
|
u,
|
|
124
121
|
"`"
|
|
125
122
|
]);
|
|
126
|
-
const f = l.length ?
|
|
127
|
-
return
|
|
123
|
+
const f = l.length ? Ee : ye, v = u.length ? Ee : ye;
|
|
124
|
+
return A([
|
|
128
125
|
"`",
|
|
129
|
-
|
|
126
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, A(i)] : _e([f, A(i)]),
|
|
130
127
|
v,
|
|
131
128
|
"`"
|
|
132
129
|
]);
|
|
133
|
-
},
|
|
134
|
-
[
|
|
130
|
+
}, ce = "embeddedCss", An = ["css"], jn = ["css", "less", "scss"], Pn = D(ce), Rn = O(ce), Nn = {
|
|
131
|
+
[Pn]: {
|
|
135
132
|
category: "Embed",
|
|
136
133
|
type: "string",
|
|
137
134
|
array: !0,
|
|
138
|
-
default: [{ value: [...
|
|
135
|
+
default: [{ value: [...An] }],
|
|
139
136
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded CSS language."
|
|
140
137
|
},
|
|
141
|
-
[
|
|
138
|
+
[Rn]: {
|
|
142
139
|
category: "Embed",
|
|
143
140
|
type: "choice",
|
|
144
141
|
default: "scss",
|
|
145
142
|
description: "The parser used to parse the embedded CSS language.",
|
|
146
|
-
choices:
|
|
143
|
+
choices: jn.map((e) => ({
|
|
147
144
|
value: e,
|
|
148
145
|
description: `Use the "${e}" parser.`
|
|
149
146
|
}))
|
|
150
147
|
}
|
|
151
|
-
},
|
|
148
|
+
}, Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
152
149
|
__proto__: null,
|
|
153
|
-
embedder:
|
|
154
|
-
language:
|
|
155
|
-
options:
|
|
156
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
157
|
-
const
|
|
150
|
+
embedder: Mn,
|
|
151
|
+
language: ce,
|
|
152
|
+
options: Nn
|
|
153
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: ve, group: j, indent: $e, softline: De } = $, wn = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
154
|
+
const s = {
|
|
158
155
|
...r,
|
|
159
156
|
...c
|
|
160
157
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -163,25 +160,25 @@ const { line: be, group: M, indent: Ee, softline: _e } = $, Rn = async (e, t, n,
|
|
|
163
160
|
l.length,
|
|
164
161
|
-u.length || void 0
|
|
165
162
|
), b = T(n, t), y = await e(E, {
|
|
166
|
-
...
|
|
167
|
-
parser:
|
|
168
|
-
}), i =
|
|
169
|
-
if (
|
|
170
|
-
return
|
|
163
|
+
...s,
|
|
164
|
+
parser: s.embeddedEsParser ?? "babel"
|
|
165
|
+
}), i = I(y, h, b);
|
|
166
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
167
|
+
return j([
|
|
171
168
|
"`",
|
|
172
169
|
l,
|
|
173
|
-
|
|
170
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [j(i)] : $e([j(i)]),
|
|
174
171
|
u,
|
|
175
172
|
"`"
|
|
176
173
|
]);
|
|
177
|
-
const f = l.length ?
|
|
178
|
-
return
|
|
174
|
+
const f = l.length ? ve : De, v = u.length ? ve : De;
|
|
175
|
+
return j([
|
|
179
176
|
"`",
|
|
180
|
-
|
|
177
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, j(i)] : $e([f, j(i)]),
|
|
181
178
|
v,
|
|
182
179
|
"`"
|
|
183
180
|
]);
|
|
184
|
-
},
|
|
181
|
+
}, de = "embeddedEs", Bn = [
|
|
185
182
|
"js",
|
|
186
183
|
"jsx",
|
|
187
184
|
"es",
|
|
@@ -190,39 +187,39 @@ const { line: be, group: M, indent: Ee, softline: _e } = $, Rn = async (e, t, n,
|
|
|
190
187
|
"cjs",
|
|
191
188
|
"pac",
|
|
192
189
|
"javascript"
|
|
193
|
-
],
|
|
190
|
+
], Un = [
|
|
194
191
|
"babel",
|
|
195
192
|
"babel-flow",
|
|
196
193
|
"acorn",
|
|
197
194
|
"espree",
|
|
198
195
|
"flow",
|
|
199
196
|
"meriyah"
|
|
200
|
-
],
|
|
201
|
-
[
|
|
197
|
+
], Wn = D(de), qn = O(de), Gn = {
|
|
198
|
+
[Wn]: {
|
|
202
199
|
category: "Embed",
|
|
203
200
|
type: "string",
|
|
204
201
|
array: !0,
|
|
205
|
-
default: [{ value: [...
|
|
202
|
+
default: [{ value: [...Bn] }],
|
|
206
203
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language."
|
|
207
204
|
},
|
|
208
|
-
[
|
|
205
|
+
[qn]: {
|
|
209
206
|
category: "Embed",
|
|
210
207
|
type: "choice",
|
|
211
208
|
default: "babel",
|
|
212
209
|
description: "The parser used to parse the embedded ECMASCript/JavaScript language.",
|
|
213
|
-
choices:
|
|
210
|
+
choices: Un.map((e) => ({
|
|
214
211
|
value: e,
|
|
215
212
|
description: `Use the "${e}" parser.`
|
|
216
213
|
}))
|
|
217
214
|
}
|
|
218
|
-
},
|
|
215
|
+
}, Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
219
216
|
__proto__: null,
|
|
220
|
-
embedder:
|
|
221
|
-
language:
|
|
222
|
-
options:
|
|
223
|
-
}, Symbol.toStringTag, { value: "Module" })), { line: Ie, group:
|
|
224
|
-
k("prettier-plugin-glsl", r,
|
|
225
|
-
const
|
|
217
|
+
embedder: wn,
|
|
218
|
+
language: de,
|
|
219
|
+
options: Gn
|
|
220
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Ie, group: P, indent: Te, softline: xe } = $, zn = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
221
|
+
k("prettier-plugin-glsl", r, o);
|
|
222
|
+
const s = {
|
|
226
223
|
...r,
|
|
227
224
|
...c
|
|
228
225
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -231,39 +228,39 @@ const { line: be, group: M, indent: Ee, softline: _e } = $, Rn = async (e, t, n,
|
|
|
231
228
|
l.length,
|
|
232
229
|
-u.length || void 0
|
|
233
230
|
), b = T(n, t), y = await e(E, {
|
|
234
|
-
...
|
|
231
|
+
...s,
|
|
235
232
|
parser: "glsl-parser"
|
|
236
|
-
}), i =
|
|
237
|
-
if (
|
|
238
|
-
return
|
|
233
|
+
}), i = I(y, h, b);
|
|
234
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
235
|
+
return P([
|
|
239
236
|
"`",
|
|
240
237
|
l,
|
|
241
|
-
|
|
238
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [P(i)] : Te([P(i)]),
|
|
242
239
|
u,
|
|
243
240
|
"`"
|
|
244
241
|
]);
|
|
245
|
-
const f = l.length ? Ie :
|
|
246
|
-
return
|
|
242
|
+
const f = l.length ? Ie : xe, v = u.length ? Ie : xe;
|
|
243
|
+
return P([
|
|
247
244
|
"`",
|
|
248
|
-
|
|
245
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, P(i)] : Te([f, P(i)]),
|
|
249
246
|
v,
|
|
250
247
|
"`"
|
|
251
248
|
]);
|
|
252
|
-
},
|
|
253
|
-
[
|
|
249
|
+
}, qt = "embeddedGlsl", Kn = ["glsl", "shader"], Jn = D(qt), Hn = {
|
|
250
|
+
[Jn]: {
|
|
254
251
|
category: "Embed",
|
|
255
252
|
type: "string",
|
|
256
253
|
array: !0,
|
|
257
|
-
default: [{ value: [...
|
|
254
|
+
default: [{ value: [...Kn] }],
|
|
258
255
|
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."
|
|
259
256
|
}
|
|
260
|
-
},
|
|
257
|
+
}, Xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
261
258
|
__proto__: null,
|
|
262
|
-
embedder:
|
|
263
|
-
language:
|
|
264
|
-
options:
|
|
265
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
266
|
-
const
|
|
259
|
+
embedder: zn,
|
|
260
|
+
language: qt,
|
|
261
|
+
options: Hn
|
|
262
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Se, group: R, indent: Le, softline: ke } = $, Yn = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
263
|
+
const s = {
|
|
267
264
|
...r,
|
|
268
265
|
...c
|
|
269
266
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -272,39 +269,39 @@ const { line: be, group: M, indent: Ee, softline: _e } = $, Rn = async (e, t, n,
|
|
|
272
269
|
l.length,
|
|
273
270
|
-u.length || void 0
|
|
274
271
|
), b = T(n, t), y = await e(E, {
|
|
275
|
-
...
|
|
272
|
+
...s,
|
|
276
273
|
parser: "graphql"
|
|
277
|
-
}), i =
|
|
278
|
-
if (
|
|
279
|
-
return
|
|
274
|
+
}), i = I(y, h, b);
|
|
275
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
276
|
+
return R([
|
|
280
277
|
"`",
|
|
281
278
|
l,
|
|
282
|
-
|
|
279
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [R(i)] : Le([R(i)]),
|
|
283
280
|
u,
|
|
284
281
|
"`"
|
|
285
282
|
]);
|
|
286
|
-
const f = l.length ?
|
|
287
|
-
return
|
|
283
|
+
const f = l.length ? Se : ke, v = u.length ? Se : ke;
|
|
284
|
+
return R([
|
|
288
285
|
"`",
|
|
289
|
-
|
|
286
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, R(i)] : Le([f, R(i)]),
|
|
290
287
|
v,
|
|
291
288
|
"`"
|
|
292
289
|
]);
|
|
293
|
-
},
|
|
294
|
-
[
|
|
290
|
+
}, Gt = "embeddedGraphql", Qn = ["graphql", "gql"], Vn = D(Gt), Zn = {
|
|
291
|
+
[Vn]: {
|
|
295
292
|
category: "Embed",
|
|
296
293
|
type: "string",
|
|
297
294
|
array: !0,
|
|
298
|
-
default: [{ value: [...
|
|
295
|
+
default: [{ value: [...Qn] }],
|
|
299
296
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded GraphQL language."
|
|
300
297
|
}
|
|
301
|
-
},
|
|
298
|
+
}, eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
302
299
|
__proto__: null,
|
|
303
|
-
embedder:
|
|
304
|
-
language:
|
|
305
|
-
options:
|
|
306
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
307
|
-
const
|
|
300
|
+
embedder: Yn,
|
|
301
|
+
language: Gt,
|
|
302
|
+
options: Zn
|
|
303
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Oe, group: N, indent: Me, softline: Ae } = $, { mapDoc: to } = Wt, no = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
304
|
+
const s = {
|
|
308
305
|
...r,
|
|
309
306
|
...c
|
|
310
307
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -313,9 +310,9 @@ const { line: be, group: M, indent: Ee, softline: _e } = $, Rn = async (e, t, n,
|
|
|
313
310
|
l.length,
|
|
314
311
|
-u.length || void 0
|
|
315
312
|
), b = T(n, t), y = await e(E, {
|
|
316
|
-
...
|
|
317
|
-
parser:
|
|
318
|
-
}), i =
|
|
313
|
+
...s,
|
|
314
|
+
parser: s.embeddedHtmlParser ?? "html"
|
|
315
|
+
}), i = to(y, (m) => {
|
|
319
316
|
if (typeof m != "string")
|
|
320
317
|
return m;
|
|
321
318
|
const g = [], _ = m.split(h);
|
|
@@ -324,56 +321,56 @@ const { line: be, group: M, indent: Ee, softline: _e } = $, Rn = async (e, t, n,
|
|
|
324
321
|
if (S % 2 === 0) {
|
|
325
322
|
if (!L)
|
|
326
323
|
continue;
|
|
327
|
-
L = L.replaceAll(/([\\`]|\${)/g, "\\$1"),
|
|
324
|
+
L = L.replaceAll(/([\\`]|\${)/g, "\\$1"), s.__embeddedInHtml && (L = L.replaceAll(/<\/(?=script\b)/gi, "<\\/")), g.push(L);
|
|
328
325
|
} else {
|
|
329
|
-
const
|
|
330
|
-
g.push(b[
|
|
326
|
+
const M = Number(L);
|
|
327
|
+
g.push(b[M]);
|
|
331
328
|
}
|
|
332
329
|
}
|
|
333
330
|
return g;
|
|
334
331
|
});
|
|
335
|
-
if (
|
|
336
|
-
|
|
337
|
-
return
|
|
332
|
+
if (s.htmlWhitespaceSensitivity === "strict" || // TODO: is css mode should be included here?
|
|
333
|
+
s.htmlWhitespaceSensitivity === "css" || s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
334
|
+
return N([
|
|
338
335
|
"`",
|
|
339
336
|
l,
|
|
340
|
-
|
|
337
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [N(i)] : Me([N(i)]),
|
|
341
338
|
u,
|
|
342
339
|
"`"
|
|
343
340
|
]);
|
|
344
|
-
const f = l.length ?
|
|
345
|
-
return
|
|
341
|
+
const f = l.length ? Oe : Ae, v = u.length ? Oe : Ae;
|
|
342
|
+
return N([
|
|
346
343
|
"`",
|
|
347
|
-
|
|
344
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, N(i)] : Me([f, N(i)]),
|
|
348
345
|
v,
|
|
349
346
|
"`"
|
|
350
347
|
]);
|
|
351
|
-
},
|
|
352
|
-
[
|
|
348
|
+
}, le = "embeddedHtml", oo = ["html", "xhtml"], so = ["html", "vue", "angular", "lwc"], ro = D(le), io = O(le), ao = {
|
|
349
|
+
[ro]: {
|
|
353
350
|
category: "Embed",
|
|
354
351
|
type: "string",
|
|
355
352
|
array: !0,
|
|
356
|
-
default: [{ value: [...
|
|
353
|
+
default: [{ value: [...oo] }],
|
|
357
354
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded HTML language."
|
|
358
355
|
},
|
|
359
|
-
[
|
|
356
|
+
[io]: {
|
|
360
357
|
category: "Embed",
|
|
361
358
|
type: "choice",
|
|
362
359
|
default: "html",
|
|
363
360
|
description: "The parser used to parse the embedded HTML language.",
|
|
364
|
-
choices:
|
|
361
|
+
choices: so.map((e) => ({
|
|
365
362
|
value: e,
|
|
366
363
|
description: `Use the "${e}" parser.`
|
|
367
364
|
}))
|
|
368
365
|
}
|
|
369
|
-
},
|
|
366
|
+
}, co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
370
367
|
__proto__: null,
|
|
371
|
-
embedder:
|
|
372
|
-
language:
|
|
373
|
-
options:
|
|
374
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
375
|
-
k("prettier-plugin-ini", r,
|
|
376
|
-
const
|
|
368
|
+
embedder: no,
|
|
369
|
+
language: le,
|
|
370
|
+
options: ao
|
|
371
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: je, group: F, indent: Pe, softline: Re } = $, lo = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
372
|
+
k("prettier-plugin-ini", r, o);
|
|
373
|
+
const s = {
|
|
377
374
|
...r,
|
|
378
375
|
...c
|
|
379
376
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -382,40 +379,40 @@ const { line: be, group: M, indent: Ee, softline: _e } = $, Rn = async (e, t, n,
|
|
|
382
379
|
l.length,
|
|
383
380
|
-u.length || void 0
|
|
384
381
|
), b = T(n, t), y = await e(E, {
|
|
385
|
-
...
|
|
382
|
+
...s,
|
|
386
383
|
parser: "ini"
|
|
387
|
-
}), i =
|
|
388
|
-
if (
|
|
384
|
+
}), i = I(y, h, b);
|
|
385
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
389
386
|
return F([
|
|
390
387
|
"`",
|
|
391
388
|
l,
|
|
392
|
-
|
|
389
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [F(i)] : Pe([F(i)]),
|
|
393
390
|
u,
|
|
394
391
|
"`"
|
|
395
392
|
]);
|
|
396
|
-
const f = l.length ?
|
|
393
|
+
const f = l.length ? je : Re, v = u.length ? je : Re;
|
|
397
394
|
return F([
|
|
398
395
|
"`",
|
|
399
|
-
|
|
396
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, F(i)] : Pe([f, F(i)]),
|
|
400
397
|
v,
|
|
401
398
|
"`"
|
|
402
399
|
]);
|
|
403
|
-
},
|
|
404
|
-
[
|
|
400
|
+
}, Ct = "embeddedIni", uo = ["ini", "cfg", "pro"], po = D(Ct), go = {
|
|
401
|
+
[po]: {
|
|
405
402
|
category: "Embed",
|
|
406
403
|
type: "string",
|
|
407
404
|
array: !0,
|
|
408
|
-
default: [{ value: [...
|
|
405
|
+
default: [{ value: [...uo] }],
|
|
409
406
|
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."
|
|
410
407
|
}
|
|
411
|
-
},
|
|
408
|
+
}, mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
412
409
|
__proto__: null,
|
|
413
|
-
embedder:
|
|
414
|
-
language:
|
|
415
|
-
options:
|
|
416
|
-
}, Symbol.toStringTag, { value: "Module" })), { group: w, line: Ne, softline:
|
|
417
|
-
k("prettier-plugin-java", r,
|
|
418
|
-
const
|
|
410
|
+
embedder: lo,
|
|
411
|
+
language: Ct,
|
|
412
|
+
options: go
|
|
413
|
+
}, Symbol.toStringTag, { value: "Module" })), { group: w, line: Ne, softline: Fe, indent: we } = $, ho = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
414
|
+
k("prettier-plugin-java", r, o);
|
|
415
|
+
const s = {
|
|
419
416
|
...r,
|
|
420
417
|
...c
|
|
421
418
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -424,73 +421,73 @@ const { line: be, group: M, indent: Ee, softline: _e } = $, Rn = async (e, t, n,
|
|
|
424
421
|
l.length,
|
|
425
422
|
-u.length || void 0
|
|
426
423
|
), b = T(n, t), y = await e(E, {
|
|
427
|
-
...
|
|
424
|
+
...s,
|
|
428
425
|
parser: "java"
|
|
429
|
-
}), i =
|
|
426
|
+
}), i = I(
|
|
430
427
|
y,
|
|
431
428
|
h,
|
|
432
429
|
b,
|
|
433
430
|
!0
|
|
434
431
|
);
|
|
435
|
-
if (
|
|
432
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
436
433
|
return w([
|
|
437
434
|
"`",
|
|
438
435
|
l,
|
|
439
|
-
|
|
436
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [w(i)] : we([w(i)]),
|
|
440
437
|
u,
|
|
441
438
|
"`"
|
|
442
439
|
]);
|
|
443
|
-
const f = l.length ? Ne :
|
|
440
|
+
const f = l.length ? Ne : Fe, v = u.length ? Ne : Fe;
|
|
444
441
|
return w([
|
|
445
442
|
"`",
|
|
446
|
-
|
|
443
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, w(i)] : we([f, w(i)]),
|
|
447
444
|
v,
|
|
448
445
|
"`"
|
|
449
446
|
]);
|
|
450
|
-
},
|
|
451
|
-
[
|
|
447
|
+
}, zt = "embeddedJava", fo = ["java"], bo = D(zt), Eo = {
|
|
448
|
+
[bo]: {
|
|
452
449
|
category: "Embed",
|
|
453
450
|
type: "string",
|
|
454
451
|
array: !0,
|
|
455
|
-
default: [{ value: [...
|
|
452
|
+
default: [{ value: [...fo] }],
|
|
456
453
|
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."
|
|
457
454
|
}
|
|
458
|
-
},
|
|
455
|
+
}, _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
459
456
|
__proto__: null,
|
|
460
|
-
embedder:
|
|
461
|
-
language:
|
|
462
|
-
options:
|
|
463
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
464
|
-
const
|
|
457
|
+
embedder: ho,
|
|
458
|
+
language: zt,
|
|
459
|
+
options: Eo
|
|
460
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Be, group: B, indent: Ue, softline: We } = $, yo = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
461
|
+
const s = {
|
|
465
462
|
...r,
|
|
466
463
|
...c
|
|
467
|
-
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } =
|
|
464
|
+
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = vo(), a = d.quasis.map(
|
|
468
465
|
(m, g, { length: _ }) => g === _ - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
469
466
|
).join(""), l = a.match(/^\s+/)?.[0] ?? "", u = a.match(/\s+$/)?.[0] ?? "", E = a.slice(
|
|
470
467
|
l.length,
|
|
471
468
|
-u.length || void 0
|
|
472
469
|
), b = T(n, t), y = await e(E, {
|
|
473
|
-
...
|
|
474
|
-
parser:
|
|
475
|
-
}), i =
|
|
476
|
-
if (
|
|
470
|
+
...s,
|
|
471
|
+
parser: s.embeddedJsonParser ?? "json"
|
|
472
|
+
}), i = I(y, h, b);
|
|
473
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
477
474
|
return B([
|
|
478
475
|
"`",
|
|
479
476
|
l,
|
|
480
|
-
|
|
477
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [B(i)] : Ue([B(i)]),
|
|
481
478
|
u,
|
|
482
479
|
"`"
|
|
483
480
|
]);
|
|
484
|
-
const f = l.length ?
|
|
481
|
+
const f = l.length ? Be : We, v = u.length ? Be : We;
|
|
485
482
|
return B([
|
|
486
483
|
"`",
|
|
487
|
-
|
|
484
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, B(i)] : Ue([f, B(i)]),
|
|
488
485
|
v,
|
|
489
486
|
"`"
|
|
490
487
|
]);
|
|
491
488
|
};
|
|
492
|
-
function
|
|
493
|
-
const e = ne(), t = ne(), n = (
|
|
489
|
+
function vo() {
|
|
490
|
+
const e = ne(), t = ne(), n = (o) => `'0${e}${o}${t}'`, r = new RegExp(
|
|
494
491
|
`["']?0${e}(\\d+)${t}['"]?`,
|
|
495
492
|
"ig"
|
|
496
493
|
);
|
|
@@ -499,36 +496,36 @@ function xo() {
|
|
|
499
496
|
placeholderRegex: r
|
|
500
497
|
};
|
|
501
498
|
}
|
|
502
|
-
const
|
|
503
|
-
[
|
|
499
|
+
const ue = "embeddedJson", $o = ["json", "jsonl"], Do = ["json", "json5", "jsonc", "json-stringify"], Io = O(ue), To = D(ue), xo = {
|
|
500
|
+
[To]: {
|
|
504
501
|
category: "Embed",
|
|
505
502
|
type: "string",
|
|
506
503
|
array: !0,
|
|
507
|
-
default: [{ value: [
|
|
504
|
+
default: [{ value: [...$o] }],
|
|
508
505
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded JSON language."
|
|
509
506
|
},
|
|
510
|
-
[
|
|
507
|
+
[Io]: {
|
|
511
508
|
category: "Embed",
|
|
512
509
|
type: "choice",
|
|
513
510
|
default: "json",
|
|
514
511
|
description: "The parser used to parse the embedded JSON language.",
|
|
515
|
-
choices:
|
|
512
|
+
choices: Do.map((e) => ({
|
|
516
513
|
value: e,
|
|
517
514
|
description: `Use the "${e}" parser.`
|
|
518
515
|
}))
|
|
519
516
|
}
|
|
520
|
-
},
|
|
517
|
+
}, So = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
521
518
|
__proto__: null,
|
|
522
|
-
embedder:
|
|
523
|
-
language:
|
|
524
|
-
options:
|
|
525
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
519
|
+
embedder: yo,
|
|
520
|
+
language: ue,
|
|
521
|
+
options: xo
|
|
522
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: qe, group: U, indent: Ge, softline: Ce } = $, Lo = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
526
523
|
k(
|
|
527
524
|
"@stedi/prettier-plugin-jsonata",
|
|
528
525
|
r,
|
|
529
|
-
|
|
526
|
+
o
|
|
530
527
|
);
|
|
531
|
-
const
|
|
528
|
+
const s = {
|
|
532
529
|
...r,
|
|
533
530
|
...c
|
|
534
531
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x("$p"), a = d.quasis.map(
|
|
@@ -537,40 +534,40 @@ const le = "embeddedJson", So = ["json", "jsonl"], Lo = ["json", "json5", "jsonc
|
|
|
537
534
|
l.length,
|
|
538
535
|
-u.length || void 0
|
|
539
536
|
), b = T(n, t), y = await e(E, {
|
|
540
|
-
...
|
|
537
|
+
...s,
|
|
541
538
|
parser: "JSONata"
|
|
542
|
-
}), i =
|
|
543
|
-
if (
|
|
539
|
+
}), i = I(y, h, b);
|
|
540
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
544
541
|
return U([
|
|
545
542
|
"`",
|
|
546
543
|
l,
|
|
547
|
-
|
|
544
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [U(i)] : Ge([U(i)]),
|
|
548
545
|
u,
|
|
549
546
|
"`"
|
|
550
547
|
]);
|
|
551
|
-
const f = l.length ?
|
|
548
|
+
const f = l.length ? qe : Ce, v = u.length ? qe : Ce;
|
|
552
549
|
return U([
|
|
553
550
|
"`",
|
|
554
|
-
|
|
551
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, U(i)] : Ge([f, U(i)]),
|
|
555
552
|
v,
|
|
556
553
|
"`"
|
|
557
554
|
]);
|
|
558
|
-
},
|
|
559
|
-
[
|
|
555
|
+
}, Kt = "embeddedJsonata", ko = ["jsonata"], Oo = D(Kt), Mo = {
|
|
556
|
+
[Oo]: {
|
|
560
557
|
category: "Embed",
|
|
561
558
|
type: "string",
|
|
562
559
|
array: !0,
|
|
563
|
-
default: [{ value: [...
|
|
560
|
+
default: [{ value: [...ko] }],
|
|
564
561
|
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."
|
|
565
562
|
}
|
|
566
|
-
},
|
|
563
|
+
}, Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
567
564
|
__proto__: null,
|
|
568
|
-
embedder:
|
|
569
|
-
language:
|
|
570
|
-
options:
|
|
571
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
572
|
-
k("prettier-plugin-latex", r,
|
|
573
|
-
const
|
|
565
|
+
embedder: Lo,
|
|
566
|
+
language: Kt,
|
|
567
|
+
options: Mo
|
|
568
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: ze, group: W, indent: Ke, softline: Je } = $, jo = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
569
|
+
k("prettier-plugin-latex", r, o);
|
|
570
|
+
const s = {
|
|
574
571
|
...r,
|
|
575
572
|
...c
|
|
576
573
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -579,25 +576,25 @@ const le = "embeddedJson", So = ["json", "jsonl"], Lo = ["json", "json5", "jsonc
|
|
|
579
576
|
l.length,
|
|
580
577
|
-u.length || void 0
|
|
581
578
|
), b = T(n, t), y = await e(E, {
|
|
582
|
-
...
|
|
579
|
+
...s,
|
|
583
580
|
parser: "latex-parser"
|
|
584
|
-
}), i =
|
|
585
|
-
if (
|
|
581
|
+
}), i = I(y, h, b);
|
|
582
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
586
583
|
return W([
|
|
587
584
|
"`",
|
|
588
585
|
l,
|
|
589
|
-
|
|
586
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [W(i)] : Ke([W(i)]),
|
|
590
587
|
u,
|
|
591
588
|
"`"
|
|
592
589
|
]);
|
|
593
|
-
const f = l.length ?
|
|
590
|
+
const f = l.length ? ze : Je, v = u.length ? ze : Je;
|
|
594
591
|
return W([
|
|
595
592
|
"`",
|
|
596
|
-
|
|
593
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, W(i)] : Ke([f, W(i)]),
|
|
597
594
|
v,
|
|
598
595
|
"`"
|
|
599
596
|
]);
|
|
600
|
-
},
|
|
597
|
+
}, Jt = "embeddedLatex", Po = [
|
|
601
598
|
"latex",
|
|
602
599
|
"tex",
|
|
603
600
|
"aux",
|
|
@@ -606,21 +603,21 @@ const le = "embeddedJson", So = ["json", "jsonl"], Lo = ["json", "json5", "jsonc
|
|
|
606
603
|
"bib",
|
|
607
604
|
"toc",
|
|
608
605
|
"sty"
|
|
609
|
-
],
|
|
610
|
-
[
|
|
606
|
+
], Ro = D(Jt), No = {
|
|
607
|
+
[Ro]: {
|
|
611
608
|
category: "Embed",
|
|
612
609
|
type: "string",
|
|
613
610
|
array: !0,
|
|
614
|
-
default: [{ value: [...
|
|
611
|
+
default: [{ value: [...Po] }],
|
|
615
612
|
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."
|
|
616
613
|
}
|
|
617
|
-
},
|
|
614
|
+
}, Fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
618
615
|
__proto__: null,
|
|
619
|
-
embedder:
|
|
620
|
-
language:
|
|
621
|
-
options:
|
|
622
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
623
|
-
const
|
|
616
|
+
embedder: jo,
|
|
617
|
+
language: Jt,
|
|
618
|
+
options: No
|
|
619
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: He, group: q, indent: Xe, softline: Ye } = $, wo = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
620
|
+
const s = {
|
|
624
621
|
...r,
|
|
625
622
|
...c
|
|
626
623
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -629,51 +626,51 @@ const le = "embeddedJson", So = ["json", "jsonl"], Lo = ["json", "json5", "jsonc
|
|
|
629
626
|
l.length,
|
|
630
627
|
-u.length || void 0
|
|
631
628
|
), b = T(n, t), y = await e(E, {
|
|
632
|
-
...
|
|
633
|
-
parser:
|
|
629
|
+
...s,
|
|
630
|
+
parser: s.embeddedMarkdownParser ?? "markdown",
|
|
634
631
|
__inJsTemplate: !0
|
|
635
|
-
}), i =
|
|
636
|
-
if (
|
|
632
|
+
}), i = I(y, h, b);
|
|
633
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
637
634
|
return q([
|
|
638
635
|
"`",
|
|
639
636
|
l,
|
|
640
|
-
|
|
637
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [q(i)] : Xe([q(i)]),
|
|
641
638
|
u,
|
|
642
639
|
"`"
|
|
643
640
|
]);
|
|
644
|
-
const f = l.length ?
|
|
641
|
+
const f = l.length ? He : Ye, v = u.length ? He : Ye;
|
|
645
642
|
return q([
|
|
646
643
|
"`",
|
|
647
|
-
|
|
644
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, q(i)] : Xe([f, q(i)]),
|
|
648
645
|
v,
|
|
649
646
|
"`"
|
|
650
647
|
]);
|
|
651
|
-
},
|
|
652
|
-
[
|
|
648
|
+
}, pe = "embeddedMarkdown", Bo = ["md", "markdown"], Uo = ["markdown", "mdx", "remark"], Wo = D(pe), qo = O(pe), Go = {
|
|
649
|
+
[Wo]: {
|
|
653
650
|
category: "Embed",
|
|
654
651
|
type: "string",
|
|
655
652
|
array: !0,
|
|
656
|
-
default: [{ value: [...
|
|
653
|
+
default: [{ value: [...Bo] }],
|
|
657
654
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Markdown language."
|
|
658
655
|
},
|
|
659
|
-
[
|
|
656
|
+
[qo]: {
|
|
660
657
|
category: "Embed",
|
|
661
658
|
type: "choice",
|
|
662
659
|
default: "markdown",
|
|
663
660
|
description: "The parser used to parse the embedded Markdown language.",
|
|
664
|
-
choices:
|
|
661
|
+
choices: Uo.map((e) => ({
|
|
665
662
|
value: e,
|
|
666
663
|
description: `Use the "${e}" parser.`
|
|
667
664
|
}))
|
|
668
665
|
}
|
|
669
|
-
},
|
|
666
|
+
}, Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
670
667
|
__proto__: null,
|
|
671
|
-
embedder:
|
|
672
|
-
language:
|
|
673
|
-
options:
|
|
674
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
675
|
-
k("prettier-plugin-nginx", r,
|
|
676
|
-
const
|
|
668
|
+
embedder: wo,
|
|
669
|
+
language: pe,
|
|
670
|
+
options: Go
|
|
671
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Qe, group: G, indent: Ve, softline: Ze } = $, zo = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
672
|
+
k("prettier-plugin-nginx", r, o);
|
|
673
|
+
const s = {
|
|
677
674
|
...r,
|
|
678
675
|
...c
|
|
679
676
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -682,52 +679,52 @@ const le = "embeddedJson", So = ["json", "jsonl"], Lo = ["json", "json5", "jsonc
|
|
|
682
679
|
l.length,
|
|
683
680
|
-u.length || void 0
|
|
684
681
|
), b = T(n, t), y = await e(E, {
|
|
685
|
-
...
|
|
682
|
+
...s,
|
|
686
683
|
parser: "nginx"
|
|
687
|
-
}), i =
|
|
688
|
-
if (
|
|
684
|
+
}), i = I(y, h, b);
|
|
685
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
689
686
|
return G([
|
|
690
687
|
"`",
|
|
691
688
|
l,
|
|
692
|
-
|
|
689
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [G(i)] : Ve([G(i)]),
|
|
693
690
|
u,
|
|
694
691
|
"`"
|
|
695
692
|
]);
|
|
696
|
-
const f = l.length ?
|
|
693
|
+
const f = l.length ? Qe : Ze, v = u.length ? Qe : Ze;
|
|
697
694
|
return G([
|
|
698
695
|
"`",
|
|
699
|
-
|
|
696
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, G(i)] : Ve([f, G(i)]),
|
|
700
697
|
v,
|
|
701
698
|
"`"
|
|
702
699
|
]);
|
|
703
|
-
},
|
|
704
|
-
[
|
|
700
|
+
}, Ht = "embeddedNginx", Ko = ["nginx"], Jo = D(Ht), Ho = {
|
|
701
|
+
[Jo]: {
|
|
705
702
|
category: "Embed",
|
|
706
703
|
type: "string",
|
|
707
704
|
array: !0,
|
|
708
|
-
default: [{ value: [...
|
|
705
|
+
default: [{ value: [...Ko] }],
|
|
709
706
|
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."
|
|
710
707
|
}
|
|
711
|
-
},
|
|
708
|
+
}, Xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
712
709
|
__proto__: null,
|
|
713
|
-
embedder:
|
|
714
|
-
language:
|
|
715
|
-
options:
|
|
716
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
717
|
-
[
|
|
710
|
+
embedder: zo,
|
|
711
|
+
language: Ht,
|
|
712
|
+
options: Ho
|
|
713
|
+
}, Symbol.toStringTag, { value: "Module" })), ge = "embeddedNoop", Yo = D(ge), Qo = {
|
|
714
|
+
[Yo]: {
|
|
718
715
|
category: "Embed",
|
|
719
716
|
type: "string",
|
|
720
717
|
array: !0,
|
|
721
718
|
default: [{ value: [] }],
|
|
722
719
|
description: "Tag or comment identifiers that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted."
|
|
723
720
|
}
|
|
724
|
-
},
|
|
721
|
+
}, Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
725
722
|
__proto__: null,
|
|
726
|
-
language:
|
|
727
|
-
options:
|
|
728
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
729
|
-
k("prettier-plugin-pegjs", r,
|
|
730
|
-
const
|
|
723
|
+
language: ge,
|
|
724
|
+
options: Qo
|
|
725
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: et, group: C, indent: tt, softline: nt } = $, Zo = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
726
|
+
k("prettier-plugin-pegjs", r, o);
|
|
727
|
+
const s = {
|
|
731
728
|
...r,
|
|
732
729
|
...c
|
|
733
730
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -736,40 +733,40 @@ const le = "embeddedJson", So = ["json", "jsonl"], Lo = ["json", "json5", "jsonc
|
|
|
736
733
|
l.length,
|
|
737
734
|
-u.length || void 0
|
|
738
735
|
), b = T(n, t), y = await e(E, {
|
|
739
|
-
...
|
|
736
|
+
...s,
|
|
740
737
|
parser: "pegjs-parser"
|
|
741
|
-
}), i =
|
|
742
|
-
if (
|
|
738
|
+
}), i = I(y, h, b);
|
|
739
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
743
740
|
return C([
|
|
744
741
|
"`",
|
|
745
742
|
l,
|
|
746
|
-
|
|
743
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [C(i)] : tt([C(i)]),
|
|
747
744
|
u,
|
|
748
745
|
"`"
|
|
749
746
|
]);
|
|
750
|
-
const f = l.length ?
|
|
747
|
+
const f = l.length ? et : nt, v = u.length ? et : nt;
|
|
751
748
|
return C([
|
|
752
749
|
"`",
|
|
753
|
-
|
|
750
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, C(i)] : tt([f, C(i)]),
|
|
754
751
|
v,
|
|
755
752
|
"`"
|
|
756
753
|
]);
|
|
757
|
-
},
|
|
758
|
-
[
|
|
754
|
+
}, Xt = "embeddedPegjs", es = ["pegjs", "peggy", "peg"], ts = D(Xt), ns = {
|
|
755
|
+
[ts]: {
|
|
759
756
|
category: "Embed",
|
|
760
757
|
type: "string",
|
|
761
758
|
array: !0,
|
|
762
|
-
default: [{ value: [...
|
|
759
|
+
default: [{ value: [...es] }],
|
|
763
760
|
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."
|
|
764
761
|
}
|
|
765
|
-
},
|
|
762
|
+
}, os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
766
763
|
__proto__: null,
|
|
767
|
-
embedder:
|
|
768
|
-
language:
|
|
769
|
-
options:
|
|
770
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
771
|
-
k("@prettier/plugin-php", r,
|
|
772
|
-
const
|
|
764
|
+
embedder: Zo,
|
|
765
|
+
language: Xt,
|
|
766
|
+
options: ns
|
|
767
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: ot, group: z, indent: st, softline: rt } = $, ss = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
768
|
+
k("@prettier/plugin-php", r, o);
|
|
769
|
+
const s = {
|
|
773
770
|
...r,
|
|
774
771
|
...c
|
|
775
772
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x("$p"), a = d.quasis.map(
|
|
@@ -778,40 +775,40 @@ const le = "embeddedJson", So = ["json", "jsonl"], Lo = ["json", "json5", "jsonc
|
|
|
778
775
|
l.length,
|
|
779
776
|
-u.length || void 0
|
|
780
777
|
), b = T(n, t), y = await e(E, {
|
|
781
|
-
...
|
|
778
|
+
...s,
|
|
782
779
|
parser: "php"
|
|
783
|
-
}), i =
|
|
784
|
-
if (
|
|
780
|
+
}), i = I(y, h, b);
|
|
781
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
785
782
|
return z([
|
|
786
783
|
"`",
|
|
787
784
|
l,
|
|
788
|
-
|
|
785
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [z(i)] : st([z(i)]),
|
|
789
786
|
u,
|
|
790
787
|
"`"
|
|
791
788
|
]);
|
|
792
|
-
const f = l.length ?
|
|
789
|
+
const f = l.length ? ot : rt, v = u.length ? ot : rt;
|
|
793
790
|
return z([
|
|
794
791
|
"`",
|
|
795
|
-
|
|
792
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, z(i)] : st([f, z(i)]),
|
|
796
793
|
v,
|
|
797
794
|
"`"
|
|
798
795
|
]);
|
|
799
|
-
},
|
|
800
|
-
[
|
|
796
|
+
}, Yt = "embeddedPhp", rs = ["php", "php5"], is = D(Yt), as = {
|
|
797
|
+
[is]: {
|
|
801
798
|
category: "Embed",
|
|
802
799
|
type: "string",
|
|
803
800
|
array: !0,
|
|
804
|
-
default: [{ value: [...
|
|
801
|
+
default: [{ value: [...rs] }],
|
|
805
802
|
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."
|
|
806
803
|
}
|
|
807
|
-
},
|
|
804
|
+
}, cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
808
805
|
__proto__: null,
|
|
809
|
-
embedder:
|
|
810
|
-
language:
|
|
811
|
-
options:
|
|
812
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
813
|
-
k("prettier-plugin-prisma", r,
|
|
814
|
-
const
|
|
806
|
+
embedder: ss,
|
|
807
|
+
language: Yt,
|
|
808
|
+
options: as
|
|
809
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: it, group: K, indent: at, softline: ct } = $, ds = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
810
|
+
k("prettier-plugin-prisma", r, o);
|
|
811
|
+
const s = {
|
|
815
812
|
...r,
|
|
816
813
|
...c
|
|
817
814
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -820,40 +817,40 @@ const le = "embeddedJson", So = ["json", "jsonl"], Lo = ["json", "json5", "jsonc
|
|
|
820
817
|
l.length,
|
|
821
818
|
-u.length || void 0
|
|
822
819
|
), b = T(n, t), y = await e(E, {
|
|
823
|
-
...
|
|
820
|
+
...s,
|
|
824
821
|
parser: "prisma-parse"
|
|
825
|
-
}), i =
|
|
826
|
-
if (
|
|
822
|
+
}), i = I(y, h, b);
|
|
823
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
827
824
|
return K([
|
|
828
825
|
"`",
|
|
829
826
|
l,
|
|
830
|
-
|
|
827
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [K(i)] : at([K(i)]),
|
|
831
828
|
u,
|
|
832
829
|
"`"
|
|
833
830
|
]);
|
|
834
|
-
const f = l.length ?
|
|
831
|
+
const f = l.length ? it : ct, v = u.length ? it : ct;
|
|
835
832
|
return K([
|
|
836
833
|
"`",
|
|
837
|
-
|
|
834
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, K(i)] : at([f, K(i)]),
|
|
838
835
|
v,
|
|
839
836
|
"`"
|
|
840
837
|
]);
|
|
841
|
-
},
|
|
842
|
-
[
|
|
838
|
+
}, Qt = "embeddedPrisma", ls = ["prisma"], us = D(Qt), ps = {
|
|
839
|
+
[us]: {
|
|
843
840
|
category: "Embed",
|
|
844
841
|
type: "string",
|
|
845
842
|
array: !0,
|
|
846
|
-
default: [{ value: [...
|
|
843
|
+
default: [{ value: [...ls] }],
|
|
847
844
|
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."
|
|
848
845
|
}
|
|
849
|
-
},
|
|
846
|
+
}, gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
850
847
|
__proto__: null,
|
|
851
|
-
embedder:
|
|
852
|
-
language:
|
|
853
|
-
options:
|
|
854
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
855
|
-
k("prettier-plugin-properties", r,
|
|
856
|
-
const
|
|
848
|
+
embedder: ds,
|
|
849
|
+
language: Qt,
|
|
850
|
+
options: ps
|
|
851
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: dt, group: J, indent: lt, softline: ut } = $, ms = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
852
|
+
k("prettier-plugin-properties", r, o);
|
|
853
|
+
const s = {
|
|
857
854
|
...r,
|
|
858
855
|
...c
|
|
859
856
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -862,40 +859,40 @@ const le = "embeddedJson", So = ["json", "jsonl"], Lo = ["json", "json5", "jsonc
|
|
|
862
859
|
l.length,
|
|
863
860
|
-u.length || void 0
|
|
864
861
|
), b = T(n, t), y = await e(E, {
|
|
865
|
-
...
|
|
862
|
+
...s,
|
|
866
863
|
parser: "dot-properties"
|
|
867
|
-
}), i =
|
|
868
|
-
if (
|
|
864
|
+
}), i = I(y, h, b);
|
|
865
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
869
866
|
return J([
|
|
870
867
|
"`",
|
|
871
868
|
l,
|
|
872
|
-
|
|
869
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [J(i)] : lt([J(i)]),
|
|
873
870
|
u,
|
|
874
871
|
"`"
|
|
875
872
|
]);
|
|
876
|
-
const f = l.length ?
|
|
873
|
+
const f = l.length ? dt : ut, v = u.length ? dt : ut;
|
|
877
874
|
return J([
|
|
878
875
|
"`",
|
|
879
|
-
|
|
876
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, J(i)] : lt([f, J(i)]),
|
|
880
877
|
v,
|
|
881
878
|
"`"
|
|
882
879
|
]);
|
|
883
|
-
},
|
|
884
|
-
[
|
|
880
|
+
}, Vt = "embeddedProperties", hs = ["properties"], fs = D(Vt), bs = {
|
|
881
|
+
[fs]: {
|
|
885
882
|
category: "Embed",
|
|
886
883
|
type: "string",
|
|
887
884
|
array: !0,
|
|
888
|
-
default: [{ value: [...
|
|
885
|
+
default: [{ value: [...hs] }],
|
|
889
886
|
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."
|
|
890
887
|
}
|
|
891
|
-
},
|
|
888
|
+
}, Es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
892
889
|
__proto__: null,
|
|
893
|
-
embedder:
|
|
894
|
-
language:
|
|
895
|
-
options:
|
|
896
|
-
}, Symbol.toStringTag, { value: "Module" })), { group: H, line:
|
|
897
|
-
k("@prettier/plugin-pug", r,
|
|
898
|
-
const
|
|
890
|
+
embedder: ms,
|
|
891
|
+
language: Vt,
|
|
892
|
+
options: bs
|
|
893
|
+
}, Symbol.toStringTag, { value: "Module" })), { group: H, line: pt, softline: gt, indent: mt } = $, _s = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
894
|
+
k("@prettier/plugin-pug", r, o);
|
|
895
|
+
const s = {
|
|
899
896
|
...r,
|
|
900
897
|
...c
|
|
901
898
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -904,45 +901,45 @@ const le = "embeddedJson", So = ["json", "jsonl"], Lo = ["json", "json5", "jsonc
|
|
|
904
901
|
l.length,
|
|
905
902
|
-u.length || void 0
|
|
906
903
|
), b = T(n, t), y = await e(E, {
|
|
907
|
-
...
|
|
904
|
+
...s,
|
|
908
905
|
parser: "pug"
|
|
909
|
-
}), i =
|
|
906
|
+
}), i = I(
|
|
910
907
|
y,
|
|
911
908
|
h,
|
|
912
909
|
b,
|
|
913
910
|
!0
|
|
914
911
|
);
|
|
915
|
-
if (
|
|
912
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
916
913
|
return H([
|
|
917
914
|
"`",
|
|
918
915
|
l,
|
|
919
|
-
|
|
916
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [H(i)] : mt([H(i)]),
|
|
920
917
|
u,
|
|
921
918
|
"`"
|
|
922
919
|
]);
|
|
923
|
-
const f = l.length ?
|
|
920
|
+
const f = l.length ? pt : gt, v = u.length ? pt : gt;
|
|
924
921
|
return H([
|
|
925
922
|
"`",
|
|
926
|
-
|
|
923
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, H(i)] : mt([f, H(i)]),
|
|
927
924
|
v,
|
|
928
925
|
"`"
|
|
929
926
|
]);
|
|
930
|
-
},
|
|
931
|
-
[
|
|
927
|
+
}, Zt = "embeddedPug", ys = ["pug", "jade"], vs = D(Zt), $s = {
|
|
928
|
+
[vs]: {
|
|
932
929
|
category: "Embed",
|
|
933
930
|
type: "string",
|
|
934
931
|
array: !0,
|
|
935
|
-
default: [{ value: [...
|
|
932
|
+
default: [{ value: [...ys] }],
|
|
936
933
|
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."
|
|
937
934
|
}
|
|
938
|
-
},
|
|
935
|
+
}, Ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
939
936
|
__proto__: null,
|
|
940
|
-
embedder:
|
|
941
|
-
language:
|
|
942
|
-
options:
|
|
943
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
944
|
-
k("@prettier/plugin-ruby", r,
|
|
945
|
-
const
|
|
937
|
+
embedder: _s,
|
|
938
|
+
language: Zt,
|
|
939
|
+
options: $s
|
|
940
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: ht, group: X, indent: ft, softline: bt } = $, Is = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
941
|
+
k("@prettier/plugin-ruby", r, o);
|
|
942
|
+
const s = {
|
|
946
943
|
...r,
|
|
947
944
|
...c
|
|
948
945
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -951,50 +948,50 @@ const le = "embeddedJson", So = ["json", "jsonl"], Lo = ["json", "json5", "jsonc
|
|
|
951
948
|
l.length,
|
|
952
949
|
-u.length || void 0
|
|
953
950
|
), b = T(n, t), y = await e(E, {
|
|
954
|
-
...
|
|
955
|
-
parser:
|
|
956
|
-
}), i =
|
|
957
|
-
if (
|
|
951
|
+
...s,
|
|
952
|
+
parser: s.embeddedRubyParser ?? "ruby"
|
|
953
|
+
}), i = I(y, h, b);
|
|
954
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
958
955
|
return X([
|
|
959
956
|
"`",
|
|
960
957
|
l,
|
|
961
|
-
|
|
958
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [X(i)] : ft([X(i)]),
|
|
962
959
|
u,
|
|
963
960
|
"`"
|
|
964
961
|
]);
|
|
965
|
-
const f = l.length ?
|
|
962
|
+
const f = l.length ? ht : bt, v = u.length ? ht : bt;
|
|
966
963
|
return X([
|
|
967
964
|
"`",
|
|
968
|
-
|
|
965
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, X(i)] : ft([f, X(i)]),
|
|
969
966
|
v,
|
|
970
967
|
"`"
|
|
971
968
|
]);
|
|
972
|
-
},
|
|
973
|
-
[
|
|
969
|
+
}, me = "embeddedRuby", Ts = ["ruby"], xs = ["ruby", "rbs", "haml"], Ss = D(me), Ls = O(me), ks = {
|
|
970
|
+
[Ss]: {
|
|
974
971
|
category: "Embed",
|
|
975
972
|
type: "string",
|
|
976
973
|
array: !0,
|
|
977
|
-
default: [{ value: [...
|
|
974
|
+
default: [{ value: [...Ts] }],
|
|
978
975
|
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."
|
|
979
976
|
},
|
|
980
|
-
[
|
|
977
|
+
[Ls]: {
|
|
981
978
|
category: "Embed",
|
|
982
979
|
type: "choice",
|
|
983
980
|
default: "ruby",
|
|
984
981
|
description: "The parser used to parse the embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin.",
|
|
985
|
-
choices:
|
|
982
|
+
choices: xs.map((e) => ({
|
|
986
983
|
value: e,
|
|
987
984
|
description: `Use the "${e}" parser.`
|
|
988
985
|
}))
|
|
989
986
|
}
|
|
990
|
-
},
|
|
987
|
+
}, Os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
991
988
|
__proto__: null,
|
|
992
|
-
embedder:
|
|
993
|
-
language:
|
|
994
|
-
options:
|
|
995
|
-
}, Symbol.toStringTag, { value: "Module" })), { group: Y, line:
|
|
996
|
-
k("prettier-plugin-sh", r,
|
|
997
|
-
const
|
|
989
|
+
embedder: Is,
|
|
990
|
+
language: me,
|
|
991
|
+
options: ks
|
|
992
|
+
}, Symbol.toStringTag, { value: "Module" })), { group: Y, line: Et, softline: _t, indent: yt } = $, Ms = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
993
|
+
k("prettier-plugin-sh", r, o);
|
|
994
|
+
const s = {
|
|
998
995
|
...r,
|
|
999
996
|
...c
|
|
1000
997
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -1003,72 +1000,72 @@ const le = "embeddedJson", So = ["json", "jsonl"], Lo = ["json", "json5", "jsonc
|
|
|
1003
1000
|
l.length,
|
|
1004
1001
|
-u.length || void 0
|
|
1005
1002
|
), b = T(n, t), y = await e(E, {
|
|
1006
|
-
...
|
|
1003
|
+
...s,
|
|
1007
1004
|
parser: "sh"
|
|
1008
|
-
}), i =
|
|
1005
|
+
}), i = I(
|
|
1009
1006
|
y,
|
|
1010
1007
|
h,
|
|
1011
1008
|
b,
|
|
1012
1009
|
!0
|
|
1013
1010
|
);
|
|
1014
|
-
if (
|
|
1011
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
1015
1012
|
return Y([
|
|
1016
1013
|
"`",
|
|
1017
1014
|
l,
|
|
1018
|
-
|
|
1015
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [Y(i)] : yt([Y(i)]),
|
|
1019
1016
|
u,
|
|
1020
1017
|
"`"
|
|
1021
1018
|
]);
|
|
1022
|
-
const f = l.length ?
|
|
1019
|
+
const f = l.length ? Et : _t, v = u.length ? Et : _t;
|
|
1023
1020
|
return Y([
|
|
1024
1021
|
"`",
|
|
1025
|
-
|
|
1022
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, Y(i)] : yt([f, Y(i)]),
|
|
1026
1023
|
v,
|
|
1027
1024
|
"`"
|
|
1028
1025
|
]);
|
|
1029
|
-
},
|
|
1030
|
-
[
|
|
1026
|
+
}, en = "embeddedSh", As = ["sh"], js = D(en), Ps = {
|
|
1027
|
+
[js]: {
|
|
1031
1028
|
category: "Embed",
|
|
1032
1029
|
type: "string",
|
|
1033
1030
|
array: !0,
|
|
1034
|
-
default: [{ value: [...
|
|
1031
|
+
default: [{ value: [...As] }],
|
|
1035
1032
|
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."
|
|
1036
1033
|
}
|
|
1037
|
-
},
|
|
1034
|
+
}, Rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1038
1035
|
__proto__: null,
|
|
1039
|
-
embedder:
|
|
1040
|
-
language:
|
|
1041
|
-
options:
|
|
1036
|
+
embedder: Ms,
|
|
1037
|
+
language: en,
|
|
1038
|
+
options: Ps
|
|
1042
1039
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1043
|
-
function
|
|
1040
|
+
function vt(e, t) {
|
|
1044
1041
|
var n = Object.keys(e);
|
|
1045
1042
|
if (Object.getOwnPropertySymbols) {
|
|
1046
1043
|
var r = Object.getOwnPropertySymbols(e);
|
|
1047
|
-
t && (r = r.filter(function(
|
|
1048
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
1044
|
+
t && (r = r.filter(function(o) {
|
|
1045
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
1049
1046
|
})), n.push.apply(n, r);
|
|
1050
1047
|
}
|
|
1051
1048
|
return n;
|
|
1052
1049
|
}
|
|
1053
|
-
function
|
|
1050
|
+
function $t(e) {
|
|
1054
1051
|
for (var t = 1; t < arguments.length; t++) {
|
|
1055
1052
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
1056
|
-
t % 2 ?
|
|
1057
|
-
|
|
1058
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
1053
|
+
t % 2 ? vt(Object(n), !0).forEach(function(r) {
|
|
1054
|
+
Ns(e, r, n[r]);
|
|
1055
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : vt(Object(n)).forEach(function(r) {
|
|
1059
1056
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
1060
1057
|
});
|
|
1061
1058
|
}
|
|
1062
1059
|
return e;
|
|
1063
1060
|
}
|
|
1064
|
-
function
|
|
1065
|
-
return t =
|
|
1061
|
+
function Ns(e, t, n) {
|
|
1062
|
+
return t = Fs(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
|
|
1066
1063
|
}
|
|
1067
|
-
function
|
|
1068
|
-
var t =
|
|
1064
|
+
function Fs(e) {
|
|
1065
|
+
var t = ws(e, "string");
|
|
1069
1066
|
return typeof t == "symbol" ? t : String(t);
|
|
1070
1067
|
}
|
|
1071
|
-
function
|
|
1068
|
+
function ws(e, t) {
|
|
1072
1069
|
if (typeof e != "object" || e === null)
|
|
1073
1070
|
return e;
|
|
1074
1071
|
var n = e[Symbol.toPrimitive];
|
|
@@ -1080,19 +1077,19 @@ function Gs(e, t) {
|
|
|
1080
1077
|
}
|
|
1081
1078
|
return (t === "string" ? String : Number)(e);
|
|
1082
1079
|
}
|
|
1083
|
-
const
|
|
1084
|
-
function
|
|
1085
|
-
return t.withOptions = (n) =>
|
|
1080
|
+
const Bs = tn({});
|
|
1081
|
+
function tn(e) {
|
|
1082
|
+
return t.withOptions = (n) => tn($t($t({}, e), n)), t;
|
|
1086
1083
|
function t(n, ...r) {
|
|
1087
|
-
const
|
|
1084
|
+
const o = typeof n == "string" ? [n] : n.raw, {
|
|
1088
1085
|
escapeSpecialCharacters: c = Array.isArray(n)
|
|
1089
1086
|
} = e;
|
|
1090
|
-
let
|
|
1091
|
-
for (let h = 0; h <
|
|
1092
|
-
let a =
|
|
1093
|
-
c && (a = a.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\{/g, "{")),
|
|
1087
|
+
let s = "";
|
|
1088
|
+
for (let h = 0; h < o.length; h++) {
|
|
1089
|
+
let a = o[h];
|
|
1090
|
+
c && (a = a.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\{/g, "{")), s += a, h < r.length && (s += r[h]);
|
|
1094
1091
|
}
|
|
1095
|
-
const d =
|
|
1092
|
+
const d = s.split(`
|
|
1096
1093
|
`);
|
|
1097
1094
|
let p = null;
|
|
1098
1095
|
for (const h of d) {
|
|
@@ -1104,19 +1101,19 @@ function en(e) {
|
|
|
1104
1101
|
}
|
|
1105
1102
|
if (p !== null) {
|
|
1106
1103
|
const h = p;
|
|
1107
|
-
|
|
1104
|
+
s = d.map((a) => a[0] === " " || a[0] === " " ? a.slice(h) : a).join(`
|
|
1108
1105
|
`);
|
|
1109
1106
|
}
|
|
1110
|
-
return
|
|
1107
|
+
return s.trim().replace(/\\n/g, `
|
|
1111
1108
|
`);
|
|
1112
1109
|
}
|
|
1113
1110
|
}
|
|
1114
|
-
const { group: Q, line:
|
|
1115
|
-
const
|
|
1111
|
+
const { group: Q, line: Dt, softline: It, indent: Tt } = $, Us = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
1112
|
+
const s = {
|
|
1116
1113
|
...r,
|
|
1117
1114
|
...c
|
|
1118
|
-
}, d =
|
|
1119
|
-
k(d,
|
|
1115
|
+
}, d = s.embeddedSqlPlugin ?? "prettier-plugin-sql";
|
|
1116
|
+
k(d, s, o);
|
|
1120
1117
|
const { node: p } = n, { createPlaceholder: h, placeholderRegex: a } = x(), l = p.quasis.map(
|
|
1121
1118
|
(m, g, { length: _ }) => g === _ - 1 ? m.value.cooked : m.value.cooked + h(g)
|
|
1122
1119
|
).join(""), u = l.match(/^\s+/)?.[0] ?? "", E = l.match(/\s+$/)?.[0] ?? "", b = l.slice(
|
|
@@ -1126,79 +1123,79 @@ const { group: Q, line: $t, softline: It, indent: Dt } = $, zs = async (e, t, n,
|
|
|
1126
1123
|
let i;
|
|
1127
1124
|
if (d === "prettier-plugin-sql-cst") {
|
|
1128
1125
|
const m = await e(b, {
|
|
1129
|
-
...
|
|
1130
|
-
parser:
|
|
1126
|
+
...s,
|
|
1127
|
+
parser: s.embeddedSqlParser ?? "sqlite"
|
|
1131
1128
|
});
|
|
1132
|
-
i =
|
|
1129
|
+
i = I(m, a, y);
|
|
1133
1130
|
} else {
|
|
1134
|
-
const m = await e(
|
|
1135
|
-
...
|
|
1131
|
+
const m = await e(Bs(b), {
|
|
1132
|
+
...s,
|
|
1136
1133
|
parser: "sql"
|
|
1137
1134
|
});
|
|
1138
|
-
i =
|
|
1135
|
+
i = I(
|
|
1139
1136
|
m,
|
|
1140
1137
|
a,
|
|
1141
1138
|
y,
|
|
1142
1139
|
!0
|
|
1143
1140
|
);
|
|
1144
1141
|
}
|
|
1145
|
-
if (
|
|
1142
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
1146
1143
|
return Q([
|
|
1147
1144
|
"`",
|
|
1148
1145
|
u,
|
|
1149
|
-
|
|
1146
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [Q(i)] : Tt([Q(i)]),
|
|
1150
1147
|
E,
|
|
1151
1148
|
"`"
|
|
1152
1149
|
]);
|
|
1153
|
-
const f = u.length ?
|
|
1150
|
+
const f = u.length ? Dt : It, v = E.length ? Dt : It;
|
|
1154
1151
|
return Q([
|
|
1155
1152
|
"`",
|
|
1156
|
-
|
|
1153
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, Q(i)] : Tt([f, Q(i)]),
|
|
1157
1154
|
v,
|
|
1158
1155
|
"`"
|
|
1159
1156
|
]);
|
|
1160
|
-
}, se = "embeddedSql",
|
|
1157
|
+
}, se = "embeddedSql", Ws = ["sql"], qs = ["prettier-plugin-sql", "prettier-plugin-sql-cst"], Gs = [
|
|
1161
1158
|
"sqlite",
|
|
1162
1159
|
"bigquery",
|
|
1163
1160
|
"mysql",
|
|
1164
1161
|
"mariadb",
|
|
1165
1162
|
"postgresql"
|
|
1166
|
-
],
|
|
1167
|
-
[
|
|
1163
|
+
], Cs = D(se), zs = On(se), Ks = O(se), Js = {
|
|
1164
|
+
[Cs]: {
|
|
1168
1165
|
category: "Embed",
|
|
1169
1166
|
type: "string",
|
|
1170
1167
|
array: !0,
|
|
1171
|
-
default: [{ value: [...
|
|
1168
|
+
default: [{ value: [...Ws] }],
|
|
1172
1169
|
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."
|
|
1173
1170
|
},
|
|
1174
|
-
[
|
|
1171
|
+
[zs]: {
|
|
1175
1172
|
category: "Embed",
|
|
1176
1173
|
type: "choice",
|
|
1177
1174
|
default: "prettier-plugin-sql",
|
|
1178
1175
|
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.",
|
|
1179
|
-
choices:
|
|
1176
|
+
choices: qs.map((e) => ({
|
|
1180
1177
|
value: e,
|
|
1181
1178
|
description: `Use the "${e}" plugin.`
|
|
1182
1179
|
}))
|
|
1183
1180
|
},
|
|
1184
|
-
[
|
|
1181
|
+
[Ks]: {
|
|
1185
1182
|
category: "Embed",
|
|
1186
1183
|
type: "choice",
|
|
1187
1184
|
default: "sqlite",
|
|
1188
1185
|
description: "Specify the embedded SQL language parser. This option is only needed with the `prettier-plugin-sql-cst` plugin.",
|
|
1189
|
-
choices:
|
|
1186
|
+
choices: Gs.map((e) => ({
|
|
1190
1187
|
value: e,
|
|
1191
1188
|
description: `Use the "${e}" parser.`
|
|
1192
1189
|
}))
|
|
1193
1190
|
}
|
|
1194
|
-
},
|
|
1191
|
+
}, Hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1195
1192
|
__proto__: null,
|
|
1196
|
-
embedder:
|
|
1193
|
+
embedder: Us,
|
|
1197
1194
|
language: se,
|
|
1198
|
-
options:
|
|
1199
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
1200
|
-
k("prettier-plugin-toml", r,
|
|
1201
|
-
const
|
|
1195
|
+
options: Js
|
|
1196
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: xt, group: V, indent: St, softline: Lt } = $, Xs = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
1197
|
+
k("prettier-plugin-toml", r, o);
|
|
1198
|
+
const s = {
|
|
1202
1199
|
...r,
|
|
1203
1200
|
...c
|
|
1204
1201
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -1207,44 +1204,44 @@ const { group: Q, line: $t, softline: It, indent: Dt } = $, zs = async (e, t, n,
|
|
|
1207
1204
|
l.length,
|
|
1208
1205
|
-u.length || void 0
|
|
1209
1206
|
), b = T(n, t), y = await e(E, {
|
|
1210
|
-
...
|
|
1207
|
+
...s,
|
|
1211
1208
|
parser: "toml"
|
|
1212
|
-
}), i =
|
|
1209
|
+
}), i = I(
|
|
1213
1210
|
y,
|
|
1214
1211
|
h,
|
|
1215
1212
|
b,
|
|
1216
1213
|
!0
|
|
1217
1214
|
);
|
|
1218
|
-
if (
|
|
1215
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
1219
1216
|
return V([
|
|
1220
1217
|
"`",
|
|
1221
1218
|
l,
|
|
1222
|
-
|
|
1219
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [V(i)] : St([V(i)]),
|
|
1223
1220
|
u,
|
|
1224
1221
|
"`"
|
|
1225
1222
|
]);
|
|
1226
|
-
const f = l.length ?
|
|
1223
|
+
const f = l.length ? xt : Lt, v = u.length ? xt : Lt;
|
|
1227
1224
|
return V([
|
|
1228
1225
|
"`",
|
|
1229
|
-
|
|
1226
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, V(i)] : St([f, V(i)]),
|
|
1230
1227
|
v,
|
|
1231
1228
|
"`"
|
|
1232
1229
|
]);
|
|
1233
|
-
},
|
|
1234
|
-
[
|
|
1230
|
+
}, nn = "embeddedToml", Ys = ["toml"], Qs = D(nn), Vs = {
|
|
1231
|
+
[Qs]: {
|
|
1235
1232
|
category: "Embed",
|
|
1236
1233
|
type: "string",
|
|
1237
1234
|
array: !0,
|
|
1238
|
-
default: [{ value: [...
|
|
1235
|
+
default: [{ value: [...Ys] }],
|
|
1239
1236
|
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."
|
|
1240
1237
|
}
|
|
1241
|
-
},
|
|
1238
|
+
}, Zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1242
1239
|
__proto__: null,
|
|
1243
|
-
embedder:
|
|
1244
|
-
language:
|
|
1245
|
-
options:
|
|
1246
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
1247
|
-
const
|
|
1240
|
+
embedder: Xs,
|
|
1241
|
+
language: nn,
|
|
1242
|
+
options: Vs
|
|
1243
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: kt, group: Z, indent: Ot, softline: Mt } = $, er = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
1244
|
+
const s = {
|
|
1248
1245
|
...r,
|
|
1249
1246
|
...c
|
|
1250
1247
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -1253,53 +1250,53 @@ const { group: Q, line: $t, softline: It, indent: Dt } = $, zs = async (e, t, n,
|
|
|
1253
1250
|
l.length,
|
|
1254
1251
|
-u.length || void 0
|
|
1255
1252
|
), b = T(n, t), y = await e(E, {
|
|
1256
|
-
...
|
|
1257
|
-
parser:
|
|
1253
|
+
...s,
|
|
1254
|
+
parser: s.embeddedTsParser ?? "typescript",
|
|
1258
1255
|
// set filepath to undefined to enable jsx auto detection:
|
|
1259
1256
|
// https://github.com/prettier/prettier/blob/427a84d24203e2d54160cde153a1e6a6390fe65a/src/language-js/parse/typescript.js#L49-L53
|
|
1260
1257
|
filepath: void 0
|
|
1261
|
-
}), i =
|
|
1262
|
-
if (
|
|
1258
|
+
}), i = I(y, h, b);
|
|
1259
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
1263
1260
|
return Z([
|
|
1264
1261
|
"`",
|
|
1265
1262
|
l,
|
|
1266
|
-
|
|
1263
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [Z(i)] : Ot([Z(i)]),
|
|
1267
1264
|
u,
|
|
1268
1265
|
"`"
|
|
1269
1266
|
]);
|
|
1270
|
-
const f = l.length ?
|
|
1267
|
+
const f = l.length ? kt : Mt, v = u.length ? kt : Mt;
|
|
1271
1268
|
return Z([
|
|
1272
1269
|
"`",
|
|
1273
|
-
|
|
1270
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, Z(i)] : Ot([f, Z(i)]),
|
|
1274
1271
|
v,
|
|
1275
1272
|
"`"
|
|
1276
1273
|
]);
|
|
1277
|
-
},
|
|
1278
|
-
[
|
|
1274
|
+
}, he = "embeddedTs", tr = ["ts", "tsx", "cts", "mts", "typescript"], nr = ["typescript", "babel-ts"], or = O(he), sr = D(he), rr = {
|
|
1275
|
+
[sr]: {
|
|
1279
1276
|
category: "Embed",
|
|
1280
1277
|
type: "string",
|
|
1281
1278
|
array: !0,
|
|
1282
|
-
default: [{ value: [...
|
|
1279
|
+
default: [{ value: [...tr] }],
|
|
1283
1280
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TypeScript language."
|
|
1284
1281
|
},
|
|
1285
|
-
[
|
|
1282
|
+
[or]: {
|
|
1286
1283
|
category: "Embed",
|
|
1287
1284
|
type: "choice",
|
|
1288
1285
|
default: "typescript",
|
|
1289
1286
|
description: "The parser used to parse the embedded TypeScript language.",
|
|
1290
|
-
choices:
|
|
1287
|
+
choices: nr.map((e) => ({
|
|
1291
1288
|
value: e,
|
|
1292
1289
|
description: `Use the "${e}" parser.`
|
|
1293
1290
|
}))
|
|
1294
1291
|
}
|
|
1295
|
-
},
|
|
1292
|
+
}, ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1296
1293
|
__proto__: null,
|
|
1297
|
-
embedder:
|
|
1298
|
-
language:
|
|
1299
|
-
options:
|
|
1300
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1301
|
-
k("@prettier/plugin-xml", r,
|
|
1302
|
-
const
|
|
1294
|
+
embedder: er,
|
|
1295
|
+
language: he,
|
|
1296
|
+
options: rr
|
|
1297
|
+
}, Symbol.toStringTag, { value: "Module" })), fe = "embeddedXml", { line: At, group: ee, indent: jt, softline: re } = $, ar = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
1298
|
+
k("@prettier/plugin-xml", r, o);
|
|
1299
|
+
const s = {
|
|
1303
1300
|
...r,
|
|
1304
1301
|
...c
|
|
1305
1302
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -1313,39 +1310,39 @@ const { group: Q, line: $t, softline: It, indent: Dt } = $, zs = async (e, t, n,
|
|
|
1313
1310
|
const g = E.slice(i);
|
|
1314
1311
|
if (g.length === 0)
|
|
1315
1312
|
break;
|
|
1316
|
-
i > 0 &&
|
|
1313
|
+
i > 0 && s.xmlWhitespaceSensitivity !== "strict" && y.push(re), s.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
1317
1314
|
0,
|
|
1318
|
-
|
|
1315
|
+
s.__embeddedXmlFragmentRecoverIndex.length
|
|
1319
1316
|
);
|
|
1320
1317
|
let _ = await e(g, {
|
|
1321
|
-
...
|
|
1322
|
-
parser:
|
|
1318
|
+
...s,
|
|
1319
|
+
parser: fe
|
|
1323
1320
|
});
|
|
1324
|
-
const [S, L] =
|
|
1321
|
+
const [S, L] = s.__embeddedXmlFragmentRecoverIndex ?? [];
|
|
1325
1322
|
S === void 0 ? i = void 0 : L === void 0 ? i += S : (_ = g.slice(S, L + 1), i += L + 1), y.push(_);
|
|
1326
1323
|
}
|
|
1327
|
-
const f =
|
|
1328
|
-
if (
|
|
1324
|
+
const f = I(y, h, b);
|
|
1325
|
+
if (s.xmlWhitespaceSensitivity === "strict" || s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
1329
1326
|
return ee([
|
|
1330
1327
|
"`",
|
|
1331
1328
|
l,
|
|
1332
|
-
|
|
1329
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [ee(f)] : jt([ee(f)]),
|
|
1333
1330
|
u,
|
|
1334
1331
|
"`"
|
|
1335
1332
|
]);
|
|
1336
1333
|
const v = l.length ? At : re, m = u.length ? At : re;
|
|
1337
1334
|
return ee([
|
|
1338
1335
|
"`",
|
|
1339
|
-
|
|
1336
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [v, ee(f)] : jt([v, ee(f)]),
|
|
1340
1337
|
m,
|
|
1341
1338
|
"`"
|
|
1342
1339
|
]);
|
|
1343
|
-
},
|
|
1344
|
-
[
|
|
1340
|
+
}, cr = ["xml", "opml", "rss", "svg"], dr = D(fe), lr = {
|
|
1341
|
+
[dr]: {
|
|
1345
1342
|
category: "Embed",
|
|
1346
1343
|
type: "string",
|
|
1347
1344
|
array: !0,
|
|
1348
|
-
default: [{ value: [...
|
|
1345
|
+
default: [{ value: [...cr] }],
|
|
1349
1346
|
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."
|
|
1350
1347
|
},
|
|
1351
1348
|
/**
|
|
@@ -1359,7 +1356,7 @@ const { group: Q, line: $t, softline: It, indent: Dt } = $, zs = async (e, t, n,
|
|
|
1359
1356
|
description: "This option is read only and is used internally as a workaround to support xml fragments"
|
|
1360
1357
|
}
|
|
1361
1358
|
};
|
|
1362
|
-
function
|
|
1359
|
+
function ur(e) {
|
|
1363
1360
|
const t = {
|
|
1364
1361
|
loc: {
|
|
1365
1362
|
start: {
|
|
@@ -1399,22 +1396,22 @@ function Pt(e) {
|
|
|
1399
1396
|
);
|
|
1400
1397
|
return Object.assign(n, t), n;
|
|
1401
1398
|
}
|
|
1402
|
-
const
|
|
1399
|
+
const pr = {
|
|
1403
1400
|
async parse(e, t) {
|
|
1404
|
-
const { parse: n } = await import("@xml-tools/parser"), { lexErrors: r, parseErrors:
|
|
1401
|
+
const { parse: n } = await import("@xml-tools/parser"), { lexErrors: r, parseErrors: o, cst: c } = n(e);
|
|
1405
1402
|
if (r.length > 0) {
|
|
1406
|
-
const
|
|
1407
|
-
throw
|
|
1403
|
+
const s = r[0];
|
|
1404
|
+
throw ur(s);
|
|
1408
1405
|
}
|
|
1409
|
-
if (
|
|
1410
|
-
let
|
|
1411
|
-
for (const d of
|
|
1406
|
+
if (o.length > 0) {
|
|
1407
|
+
let s = !1;
|
|
1408
|
+
for (const d of o) {
|
|
1412
1409
|
if (!["MismatchedTokenException", "NotAllInputParsedException"].includes(
|
|
1413
1410
|
d.name
|
|
1414
1411
|
))
|
|
1415
1412
|
throw Pt(d);
|
|
1416
1413
|
if (d.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
|
|
1417
|
-
|
|
1414
|
+
s = !0;
|
|
1418
1415
|
continue;
|
|
1419
1416
|
}
|
|
1420
1417
|
if (/Expecting token of type --> EOF <-- but found --> '[\s\S]+' <--/.test(
|
|
@@ -1437,12 +1434,12 @@ const br = {
|
|
|
1437
1434
|
t.__embeddedXmlFragmentRecoverIndex.length,
|
|
1438
1435
|
d.token.startOffset,
|
|
1439
1436
|
d.token.endOffset
|
|
1440
|
-
),
|
|
1437
|
+
), s = !0;
|
|
1441
1438
|
break;
|
|
1442
1439
|
}
|
|
1443
1440
|
throw Pt(d);
|
|
1444
1441
|
}
|
|
1445
|
-
|
|
1442
|
+
s && on(c);
|
|
1446
1443
|
}
|
|
1447
1444
|
return c;
|
|
1448
1445
|
},
|
|
@@ -1454,33 +1451,33 @@ const br = {
|
|
|
1454
1451
|
return e.location.endOffset ?? NaN;
|
|
1455
1452
|
}
|
|
1456
1453
|
};
|
|
1457
|
-
function
|
|
1454
|
+
function on(e) {
|
|
1458
1455
|
const t = e.children;
|
|
1459
1456
|
for (const n in t) {
|
|
1460
1457
|
const r = t[n] ?? [];
|
|
1461
|
-
for (let
|
|
1462
|
-
const c = r[
|
|
1463
|
-
if (
|
|
1458
|
+
for (let o = r.length - 1; o >= 0; --o) {
|
|
1459
|
+
const c = r[o];
|
|
1460
|
+
if (gr(c)) {
|
|
1464
1461
|
if (Object.keys(c.children).length === 0) {
|
|
1465
|
-
r.splice(
|
|
1462
|
+
r.splice(o, 1), r.length === 0 && delete t[n];
|
|
1466
1463
|
continue;
|
|
1467
1464
|
}
|
|
1468
|
-
|
|
1465
|
+
on(c);
|
|
1469
1466
|
}
|
|
1470
1467
|
}
|
|
1471
1468
|
}
|
|
1472
1469
|
}
|
|
1473
|
-
function
|
|
1470
|
+
function gr(e) {
|
|
1474
1471
|
return "name" in e && "children" in e && "location" in e;
|
|
1475
1472
|
}
|
|
1476
|
-
const
|
|
1473
|
+
const mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1477
1474
|
__proto__: null,
|
|
1478
|
-
embedder:
|
|
1479
|
-
language:
|
|
1480
|
-
options:
|
|
1481
|
-
parser:
|
|
1482
|
-
}, Symbol.toStringTag, { value: "Module" })), { line:
|
|
1483
|
-
const
|
|
1475
|
+
embedder: ar,
|
|
1476
|
+
language: fe,
|
|
1477
|
+
options: lr,
|
|
1478
|
+
parser: pr
|
|
1479
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Rt, group: te, indent: Nt, softline: Ft } = $, hr = async (e, t, n, r, { identifier: o, embeddedOverrideOptions: c }) => {
|
|
1480
|
+
const s = {
|
|
1484
1481
|
...r,
|
|
1485
1482
|
...c
|
|
1486
1483
|
}, { node: d } = n, { createPlaceholder: p, placeholderRegex: h } = x(), a = d.quasis.map(
|
|
@@ -1489,114 +1486,114 @@ const _r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1489
1486
|
l.length,
|
|
1490
1487
|
-u.length || void 0
|
|
1491
1488
|
), b = T(n, t), y = await e(E, {
|
|
1492
|
-
...
|
|
1489
|
+
...s,
|
|
1493
1490
|
parser: "yaml"
|
|
1494
|
-
}), i =
|
|
1495
|
-
if (
|
|
1491
|
+
}), i = I(y, h, b);
|
|
1492
|
+
if (s.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
1496
1493
|
return te([
|
|
1497
1494
|
"`",
|
|
1498
1495
|
l,
|
|
1499
|
-
|
|
1496
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [te(i)] : Nt([te(i)]),
|
|
1500
1497
|
u,
|
|
1501
1498
|
"`"
|
|
1502
1499
|
]);
|
|
1503
|
-
const f = l.length ?
|
|
1500
|
+
const f = l.length ? Rt : Ft, v = u.length ? Rt : Ft;
|
|
1504
1501
|
return te([
|
|
1505
1502
|
"`",
|
|
1506
|
-
|
|
1503
|
+
s.noEmbeddedMultiLineIndentation?.includes(o) ? [f, te(i)] : Nt([f, te(i)]),
|
|
1507
1504
|
v,
|
|
1508
1505
|
"`"
|
|
1509
1506
|
]);
|
|
1510
|
-
},
|
|
1511
|
-
[
|
|
1507
|
+
}, sn = "embeddedYaml", fr = ["yaml", "yml"], br = D(sn), Er = {
|
|
1508
|
+
[br]: {
|
|
1512
1509
|
category: "Embed",
|
|
1513
1510
|
type: "string",
|
|
1514
1511
|
array: !0,
|
|
1515
|
-
default: [{ value: [...
|
|
1512
|
+
default: [{ value: [...fr] }],
|
|
1516
1513
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded YAML language."
|
|
1517
1514
|
}
|
|
1518
|
-
},
|
|
1515
|
+
}, _r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1519
1516
|
__proto__: null,
|
|
1520
|
-
embedder:
|
|
1521
|
-
language:
|
|
1522
|
-
options:
|
|
1523
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1524
|
-
"./css/index.ts":
|
|
1525
|
-
"./es/index.ts":
|
|
1526
|
-
"./glsl/index.ts":
|
|
1527
|
-
"./graphql/index.ts":
|
|
1528
|
-
"./html/index.ts":
|
|
1529
|
-
"./ini/index.ts":
|
|
1530
|
-
"./java/index.ts":
|
|
1531
|
-
"./json/index.ts":
|
|
1532
|
-
"./jsonata/index.ts":
|
|
1533
|
-
"./latex/index.ts":
|
|
1534
|
-
"./markdown/index.ts":
|
|
1535
|
-
"./nginx/index.ts":
|
|
1536
|
-
"./noop/index.ts":
|
|
1537
|
-
"./pegjs/index.ts":
|
|
1538
|
-
"./php/index.ts":
|
|
1539
|
-
"./prisma/index.ts":
|
|
1540
|
-
"./properties/index.ts":
|
|
1541
|
-
"./pug/index.ts":
|
|
1542
|
-
"./ruby/index.ts":
|
|
1543
|
-
"./sh/index.ts":
|
|
1544
|
-
"./sql/index.ts":
|
|
1545
|
-
"./toml/index.ts":
|
|
1546
|
-
"./ts/index.ts":
|
|
1547
|
-
"./xml/index.ts":
|
|
1548
|
-
"./yaml/index.ts":
|
|
1517
|
+
embedder: hr,
|
|
1518
|
+
language: sn,
|
|
1519
|
+
options: Er
|
|
1520
|
+
}, Symbol.toStringTag, { value: "Module" })), rn = [], an = {}, cn = {}, dn = {}, yr = /* @__PURE__ */ Object.assign({
|
|
1521
|
+
"./css/index.ts": Fn,
|
|
1522
|
+
"./es/index.ts": Cn,
|
|
1523
|
+
"./glsl/index.ts": Xn,
|
|
1524
|
+
"./graphql/index.ts": eo,
|
|
1525
|
+
"./html/index.ts": co,
|
|
1526
|
+
"./ini/index.ts": mo,
|
|
1527
|
+
"./java/index.ts": _o,
|
|
1528
|
+
"./json/index.ts": So,
|
|
1529
|
+
"./jsonata/index.ts": Ao,
|
|
1530
|
+
"./latex/index.ts": Fo,
|
|
1531
|
+
"./markdown/index.ts": Co,
|
|
1532
|
+
"./nginx/index.ts": Xo,
|
|
1533
|
+
"./noop/index.ts": Vo,
|
|
1534
|
+
"./pegjs/index.ts": os,
|
|
1535
|
+
"./php/index.ts": cs,
|
|
1536
|
+
"./prisma/index.ts": gs,
|
|
1537
|
+
"./properties/index.ts": Es,
|
|
1538
|
+
"./pug/index.ts": Ds,
|
|
1539
|
+
"./ruby/index.ts": Os,
|
|
1540
|
+
"./sh/index.ts": Rs,
|
|
1541
|
+
"./sql/index.ts": Hs,
|
|
1542
|
+
"./toml/index.ts": Zs,
|
|
1543
|
+
"./ts/index.ts": ir,
|
|
1544
|
+
"./xml/index.ts": mr,
|
|
1545
|
+
"./yaml/index.ts": _r
|
|
1549
1546
|
});
|
|
1550
|
-
for (const { language: e, parser: t, embedder: n, options: r } of Object.values(
|
|
1551
|
-
|
|
1552
|
-
const
|
|
1553
|
-
...
|
|
1554
|
-
[
|
|
1547
|
+
for (const { language: e, parser: t, embedder: n, options: r } of Object.values(yr))
|
|
1548
|
+
kn(rn, e, ge), t && (an[e] = t), n && (cn[e] = n), Object.assign(dn, r);
|
|
1549
|
+
const vr = "noEmbeddedIdentificationByComment", $r = "noEmbeddedIdentificationByTag", Dr = "preserveEmbeddedExteriorWhitespaces", Ir = "noEmbeddedMultiLineIndentation", Tr = "embeddedOverrides", ei = {
|
|
1550
|
+
...dn,
|
|
1551
|
+
[vr]: {
|
|
1555
1552
|
category: "Embed",
|
|
1556
1553
|
type: "string",
|
|
1557
1554
|
array: !0,
|
|
1558
1555
|
default: [{ value: [] }],
|
|
1559
1556
|
description: "Turns off `` /* identifier */ `...` `` comment-based embedded language identification for the specified identifiers."
|
|
1560
1557
|
},
|
|
1561
|
-
[
|
|
1558
|
+
[$r]: {
|
|
1562
1559
|
category: "Embed",
|
|
1563
1560
|
type: "string",
|
|
1564
1561
|
array: !0,
|
|
1565
1562
|
default: [{ value: [] }],
|
|
1566
1563
|
description: "Turns off `` identifier`...` `` tag-based embedded language identification for the specified identifiers."
|
|
1567
1564
|
},
|
|
1568
|
-
[
|
|
1565
|
+
[Dr]: {
|
|
1569
1566
|
category: "Embed",
|
|
1570
1567
|
type: "string",
|
|
1571
1568
|
array: !0,
|
|
1572
1569
|
default: [{ value: [] }],
|
|
1573
1570
|
description: "Preserves leading and trailing whitespaces in the formatting results for the specified identifiers."
|
|
1574
1571
|
},
|
|
1575
|
-
[
|
|
1572
|
+
[Ir]: {
|
|
1576
1573
|
category: "Embed",
|
|
1577
1574
|
type: "string",
|
|
1578
1575
|
array: !0,
|
|
1579
1576
|
default: [{ value: [] }],
|
|
1580
1577
|
description: "Turns off auto indentation in the formatting results for the specified identifiers when they are formatted to span multi lines."
|
|
1581
1578
|
},
|
|
1582
|
-
[
|
|
1579
|
+
[Tr]: {
|
|
1583
1580
|
category: "Embed",
|
|
1584
1581
|
type: "string",
|
|
1585
1582
|
array: !1,
|
|
1586
1583
|
default: void 0,
|
|
1587
1584
|
description: "Option overrides for the specified identifiers. It should either be a stringified JSON or an absolute filepath to the option overrides file."
|
|
1588
1585
|
}
|
|
1589
|
-
},
|
|
1586
|
+
}, wt = {
|
|
1590
1587
|
// parsers from internal
|
|
1591
|
-
...hn.parsers,
|
|
1592
1588
|
...fn.parsers,
|
|
1593
1589
|
...bn.parsers,
|
|
1594
|
-
..._n.parsers,
|
|
1595
1590
|
...En.parsers,
|
|
1591
|
+
...yn.parsers,
|
|
1592
|
+
..._n.parsers,
|
|
1596
1593
|
// parsers from this plugin
|
|
1597
|
-
...
|
|
1594
|
+
...an
|
|
1598
1595
|
};
|
|
1599
|
-
var
|
|
1596
|
+
var xr = {
|
|
1600
1597
|
isEqual: !0,
|
|
1601
1598
|
isMatchingKey: !0,
|
|
1602
1599
|
isPromise: !0,
|
|
@@ -1605,24 +1602,24 @@ var Ar = {
|
|
|
1605
1602
|
onCacheChange: !0,
|
|
1606
1603
|
onCacheHit: !0,
|
|
1607
1604
|
transformKey: !0
|
|
1608
|
-
},
|
|
1605
|
+
}, Sr = Array.prototype.slice;
|
|
1609
1606
|
function oe(e) {
|
|
1610
1607
|
var t = e.length;
|
|
1611
|
-
return t ? t === 1 ? [e[0]] : t === 2 ? [e[0], e[1]] : t === 3 ? [e[0], e[1], e[2]] :
|
|
1608
|
+
return t ? t === 1 ? [e[0]] : t === 2 ? [e[0], e[1]] : t === 3 ? [e[0], e[1], e[2]] : Sr.call(e, 0) : [];
|
|
1612
1609
|
}
|
|
1613
|
-
function
|
|
1610
|
+
function Lr(e) {
|
|
1614
1611
|
var t = {};
|
|
1615
1612
|
for (var n in e)
|
|
1616
|
-
|
|
1613
|
+
xr[n] || (t[n] = e[n]);
|
|
1617
1614
|
return t;
|
|
1618
1615
|
}
|
|
1619
|
-
function
|
|
1616
|
+
function kr(e) {
|
|
1620
1617
|
return typeof e == "function" && e.isMemoized;
|
|
1621
1618
|
}
|
|
1622
|
-
function
|
|
1619
|
+
function Or(e, t) {
|
|
1623
1620
|
return e === t || e !== e && t !== t;
|
|
1624
1621
|
}
|
|
1625
|
-
function
|
|
1622
|
+
function Bt(e, t) {
|
|
1626
1623
|
var n = {};
|
|
1627
1624
|
for (var r in e)
|
|
1628
1625
|
n[r] = e[r];
|
|
@@ -1630,7 +1627,7 @@ function wt(e, t) {
|
|
|
1630
1627
|
n[r] = t[r];
|
|
1631
1628
|
return n;
|
|
1632
1629
|
}
|
|
1633
|
-
var
|
|
1630
|
+
var Mr = (
|
|
1634
1631
|
/** @class */
|
|
1635
1632
|
function() {
|
|
1636
1633
|
function e(t) {
|
|
@@ -1663,193 +1660,231 @@ var Rr = (
|
|
|
1663
1660
|
enumerable: !1,
|
|
1664
1661
|
configurable: !0
|
|
1665
1662
|
}), e.prototype._getKeyIndexFromMatchingKey = function(t) {
|
|
1666
|
-
var n = this.options, r = n.isMatchingKey,
|
|
1667
|
-
if (!
|
|
1663
|
+
var n = this.options, r = n.isMatchingKey, o = n.maxSize, c = this.keys, s = c.length;
|
|
1664
|
+
if (!s)
|
|
1668
1665
|
return -1;
|
|
1669
1666
|
if (r(c[0], t))
|
|
1670
1667
|
return 0;
|
|
1671
|
-
if (
|
|
1672
|
-
for (var d = 1; d <
|
|
1668
|
+
if (o > 1) {
|
|
1669
|
+
for (var d = 1; d < s; d++)
|
|
1673
1670
|
if (r(c[d], t))
|
|
1674
1671
|
return d;
|
|
1675
1672
|
}
|
|
1676
1673
|
return -1;
|
|
1677
1674
|
}, e.prototype._getKeyIndexForMany = function(t) {
|
|
1678
|
-
var n = this.options.isEqual, r = this.keys,
|
|
1679
|
-
if (!
|
|
1675
|
+
var n = this.options.isEqual, r = this.keys, o = r.length;
|
|
1676
|
+
if (!o)
|
|
1680
1677
|
return -1;
|
|
1681
|
-
if (
|
|
1678
|
+
if (o === 1)
|
|
1682
1679
|
return this._getKeyIndexForSingle(t);
|
|
1683
|
-
var c = t.length,
|
|
1680
|
+
var c = t.length, s, d;
|
|
1684
1681
|
if (c > 1) {
|
|
1685
|
-
for (var p = 0; p <
|
|
1686
|
-
if (
|
|
1687
|
-
for (d = 0; d < c && n(
|
|
1682
|
+
for (var p = 0; p < o; p++)
|
|
1683
|
+
if (s = r[p], s.length === c) {
|
|
1684
|
+
for (d = 0; d < c && n(s[d], t[d]); d++)
|
|
1688
1685
|
;
|
|
1689
1686
|
if (d === c)
|
|
1690
1687
|
return p;
|
|
1691
1688
|
}
|
|
1692
1689
|
} else
|
|
1693
|
-
for (var p = 0; p <
|
|
1694
|
-
if (
|
|
1690
|
+
for (var p = 0; p < o; p++)
|
|
1691
|
+
if (s = r[p], s.length === c && n(s[0], t[0]))
|
|
1695
1692
|
return p;
|
|
1696
1693
|
return -1;
|
|
1697
1694
|
}, e.prototype._getKeyIndexForSingle = function(t) {
|
|
1698
1695
|
var n = this.keys;
|
|
1699
1696
|
if (!n.length)
|
|
1700
1697
|
return -1;
|
|
1701
|
-
var r = n[0],
|
|
1702
|
-
if (t.length !==
|
|
1698
|
+
var r = n[0], o = r.length;
|
|
1699
|
+
if (t.length !== o)
|
|
1703
1700
|
return -1;
|
|
1704
1701
|
var c = this.options.isEqual;
|
|
1705
|
-
if (
|
|
1706
|
-
for (var
|
|
1707
|
-
if (!c(r[
|
|
1702
|
+
if (o > 1) {
|
|
1703
|
+
for (var s = 0; s < o; s++)
|
|
1704
|
+
if (!c(r[s], t[s]))
|
|
1708
1705
|
return -1;
|
|
1709
1706
|
return 0;
|
|
1710
1707
|
}
|
|
1711
1708
|
return c(r[0], t[0]) ? 0 : -1;
|
|
1712
1709
|
}, e.prototype.orderByLru = function(t, n, r) {
|
|
1713
|
-
for (var
|
|
1714
|
-
|
|
1715
|
-
|
|
1710
|
+
for (var o = this.keys, c = this.values, s = o.length, d = r; d--; )
|
|
1711
|
+
o[d + 1] = o[d], c[d + 1] = c[d];
|
|
1712
|
+
o[0] = t, c[0] = n;
|
|
1716
1713
|
var p = this.options.maxSize;
|
|
1717
|
-
|
|
1714
|
+
s === p && r === s ? (o.pop(), c.pop()) : r >= p && (o.length = c.length = p);
|
|
1718
1715
|
}, e.prototype.updateAsyncCache = function(t) {
|
|
1719
|
-
var n = this, r = this.options,
|
|
1716
|
+
var n = this, r = this.options, o = r.onCacheChange, c = r.onCacheHit, s = this.keys[0], d = this.values[0];
|
|
1720
1717
|
this.values[0] = d.then(function(p) {
|
|
1721
|
-
return n.shouldUpdateOnHit && c(n, n.options, t), n.shouldUpdateOnChange &&
|
|
1718
|
+
return n.shouldUpdateOnHit && c(n, n.options, t), n.shouldUpdateOnChange && o(n, n.options, t), p;
|
|
1722
1719
|
}, function(p) {
|
|
1723
|
-
var h = n.getKeyIndex(
|
|
1720
|
+
var h = n.getKeyIndex(s);
|
|
1724
1721
|
throw h !== -1 && (n.keys.splice(h, 1), n.values.splice(h, 1)), p;
|
|
1725
1722
|
});
|
|
1726
1723
|
}, e;
|
|
1727
1724
|
}()
|
|
1728
1725
|
);
|
|
1729
|
-
function
|
|
1730
|
-
if (t === void 0 && (t = {}),
|
|
1731
|
-
return
|
|
1726
|
+
function ln(e, t) {
|
|
1727
|
+
if (t === void 0 && (t = {}), kr(e))
|
|
1728
|
+
return ln(e.fn, Bt(e.options, t));
|
|
1732
1729
|
if (typeof e != "function")
|
|
1733
1730
|
throw new TypeError("You must pass a function to `memoize`.");
|
|
1734
|
-
var n = t.isEqual, r = n === void 0 ?
|
|
1731
|
+
var n = t.isEqual, r = n === void 0 ? Or : n, o = t.isMatchingKey, c = t.isPromise, s = c === void 0 ? !1 : c, d = t.maxSize, p = d === void 0 ? 1 : d, h = t.onCacheAdd, a = t.onCacheChange, l = t.onCacheHit, u = t.transformKey, E = Bt({
|
|
1735
1732
|
isEqual: r,
|
|
1736
|
-
isMatchingKey:
|
|
1737
|
-
isPromise:
|
|
1733
|
+
isMatchingKey: o,
|
|
1734
|
+
isPromise: s,
|
|
1738
1735
|
maxSize: p,
|
|
1739
1736
|
onCacheAdd: h,
|
|
1740
1737
|
onCacheChange: a,
|
|
1741
1738
|
onCacheHit: l,
|
|
1742
1739
|
transformKey: u
|
|
1743
|
-
},
|
|
1740
|
+
}, Lr(t)), b = new Mr(E), y = b.keys, i = b.values, f = b.canTransformKey, v = b.shouldCloneArguments, m = b.shouldUpdateOnAdd, g = b.shouldUpdateOnChange, _ = b.shouldUpdateOnHit, S = function() {
|
|
1744
1741
|
var L = v ? oe(arguments) : arguments;
|
|
1745
1742
|
f && (L = u(L));
|
|
1746
|
-
var
|
|
1747
|
-
if (
|
|
1748
|
-
_ && l(b, E, S),
|
|
1743
|
+
var M = y.length ? b.getKeyIndex(L) : -1;
|
|
1744
|
+
if (M !== -1)
|
|
1745
|
+
_ && l(b, E, S), M && (b.orderByLru(y[M], i[M], M), g && a(b, E, S));
|
|
1749
1746
|
else {
|
|
1750
|
-
var
|
|
1751
|
-
b.orderByLru(
|
|
1747
|
+
var mn = e.apply(this, arguments), hn = v ? L : oe(arguments);
|
|
1748
|
+
b.orderByLru(hn, mn, y.length), s && b.updateAsyncCache(S), m && h(b, E, S), g && a(b, E, S);
|
|
1752
1749
|
}
|
|
1753
1750
|
return i[0];
|
|
1754
1751
|
};
|
|
1755
1752
|
return S.cache = b, S.fn = e, S.isMemoized = !0, S.options = E, S;
|
|
1756
1753
|
}
|
|
1757
|
-
|
|
1754
|
+
const Ar = /("(?:\\?[^])*?")|(\/\/.*)|(\/\*[^]*?\*\/)/g, jr = /("(?:\\?[^])*?")|(,\s*)(?=]|})/g, ae = {
|
|
1755
|
+
parse: (e) => {
|
|
1756
|
+
e = String(e);
|
|
1757
|
+
try {
|
|
1758
|
+
return JSON.parse(e);
|
|
1759
|
+
} catch {
|
|
1760
|
+
return JSON.parse(e.replace(Ar, "$1").replace(jr, "$1"));
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
};
|
|
1764
|
+
async function Ut(e) {
|
|
1758
1765
|
try {
|
|
1759
|
-
const t = await
|
|
1760
|
-
return
|
|
1766
|
+
const { readFile: t } = await import("node:fs/promises"), n = await t(e, { encoding: "utf-8" });
|
|
1767
|
+
return ae.parse(n);
|
|
1761
1768
|
} catch {
|
|
1762
1769
|
}
|
|
1763
1770
|
}
|
|
1764
|
-
const
|
|
1765
|
-
`data:text/javascript,${encodeURIComponent('import{pathToFileURL as
|
|
1771
|
+
const Pr = /* @__PURE__ */ new URL(
|
|
1772
|
+
`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);')}`
|
|
1773
|
+
), Rr = /* @__PURE__ */ new URL(
|
|
1774
|
+
`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);')}`
|
|
1766
1775
|
);
|
|
1767
|
-
async function
|
|
1768
|
-
|
|
1769
|
-
|
|
1776
|
+
async function Nr(e) {
|
|
1777
|
+
const { Worker: t } = await import("node:worker_threads");
|
|
1778
|
+
return new Promise((n) => {
|
|
1779
|
+
const r = new t(Pr, {
|
|
1770
1780
|
workerData: {
|
|
1771
1781
|
absolutePath: e
|
|
1772
1782
|
}
|
|
1773
1783
|
});
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
}),
|
|
1777
|
-
console.error(
|
|
1784
|
+
r.once("message", (o) => {
|
|
1785
|
+
n(o);
|
|
1786
|
+
}), r.once("error", (o) => {
|
|
1787
|
+
console.error(o), n(void 0);
|
|
1778
1788
|
});
|
|
1779
1789
|
});
|
|
1780
1790
|
}
|
|
1781
|
-
async function
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1791
|
+
async function Fr(e) {
|
|
1792
|
+
const { Worker: t } = await import("node:worker_threads");
|
|
1793
|
+
return new Promise((n) => {
|
|
1794
|
+
const r = new t(Rr, {
|
|
1795
|
+
workerData: {
|
|
1796
|
+
absolutePath: e,
|
|
1797
|
+
importMetaUrl: import.meta.url
|
|
1798
|
+
}
|
|
1799
|
+
});
|
|
1800
|
+
r.once("message", (o) => {
|
|
1801
|
+
n(o);
|
|
1802
|
+
}), r.once("error", (o) => {
|
|
1803
|
+
console.error(o), n(void 0);
|
|
1804
|
+
});
|
|
1805
|
+
});
|
|
1785
1806
|
}
|
|
1786
|
-
const
|
|
1807
|
+
const wr = ln(
|
|
1787
1808
|
async (e, t) => {
|
|
1788
|
-
|
|
1809
|
+
const { isAbsolute: n, dirname: r, resolve: o } = await import("node:path");
|
|
1810
|
+
if (n(e))
|
|
1789
1811
|
return e;
|
|
1790
|
-
const
|
|
1791
|
-
let
|
|
1792
|
-
return typeof
|
|
1812
|
+
const c = await $n(t);
|
|
1813
|
+
let s;
|
|
1814
|
+
return typeof c != "string" ? s = process.env.PWD ?? process.cwd() : s = r(c), o(s, e);
|
|
1793
1815
|
}
|
|
1794
|
-
),
|
|
1795
|
-
const n =
|
|
1816
|
+
), Br = async (e, t) => {
|
|
1817
|
+
const n = wr(
|
|
1796
1818
|
e,
|
|
1797
1819
|
t
|
|
1798
|
-
)
|
|
1799
|
-
|
|
1800
|
-
|
|
1820
|
+
);
|
|
1821
|
+
let r;
|
|
1822
|
+
try {
|
|
1823
|
+
r = (await import("node:path")).extname(
|
|
1824
|
+
e
|
|
1825
|
+
);
|
|
1826
|
+
} catch {
|
|
1827
|
+
try {
|
|
1828
|
+
return ae.parse(e);
|
|
1829
|
+
} catch {
|
|
1830
|
+
console.error("Failed to parse embeddedOverrides as a json object");
|
|
1831
|
+
return;
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
if (r === ".json" || r === ".jsonc") {
|
|
1835
|
+
const o = await n, c = await Ut(o);
|
|
1801
1836
|
if (c !== void 0)
|
|
1802
1837
|
return c;
|
|
1803
|
-
console.error(`Failed to parse the json file: ${
|
|
1838
|
+
console.error(`Failed to parse the json file: ${o}`);
|
|
1804
1839
|
return;
|
|
1805
1840
|
}
|
|
1806
1841
|
if (r === ".mjs" || r === ".cjs" || r === ".js") {
|
|
1807
|
-
const
|
|
1842
|
+
const o = await n, c = await Nr(o);
|
|
1808
1843
|
if (c !== void 0)
|
|
1809
1844
|
return c;
|
|
1810
|
-
console.error(`Failed to parse the js module file: ${
|
|
1845
|
+
console.error(`Failed to parse the js module file: ${o}`);
|
|
1811
1846
|
return;
|
|
1812
1847
|
}
|
|
1813
1848
|
if (r === ".mts" || r === ".cts" || r === ".ts") {
|
|
1814
|
-
const
|
|
1849
|
+
const o = await n, c = await Fr(o);
|
|
1815
1850
|
if (c !== void 0)
|
|
1816
1851
|
return c;
|
|
1817
|
-
console.error(`Failed to parse the ts module file: ${
|
|
1852
|
+
console.error(`Failed to parse the ts module file: ${o}`);
|
|
1818
1853
|
return;
|
|
1819
1854
|
}
|
|
1820
1855
|
if (r === "") {
|
|
1821
|
-
const
|
|
1856
|
+
const o = await n, c = await Ut(o);
|
|
1822
1857
|
if (c !== void 0)
|
|
1823
1858
|
return c;
|
|
1824
1859
|
}
|
|
1825
1860
|
try {
|
|
1826
|
-
return
|
|
1861
|
+
return ae.parse(e);
|
|
1827
1862
|
} catch {
|
|
1828
1863
|
console.error("Failed to parse embeddedOverrides as a json object");
|
|
1829
1864
|
}
|
|
1830
|
-
},
|
|
1865
|
+
}, Ur = async (e, t, n) => {
|
|
1831
1866
|
if (e === void 0)
|
|
1832
1867
|
return;
|
|
1833
|
-
const r = await
|
|
1868
|
+
const r = await Br(
|
|
1834
1869
|
e,
|
|
1835
1870
|
n
|
|
1836
1871
|
);
|
|
1837
1872
|
if (r !== void 0)
|
|
1838
1873
|
try {
|
|
1839
|
-
for (const { identifiers:
|
|
1840
|
-
if (
|
|
1874
|
+
for (const { identifiers: o, options: c } of r)
|
|
1875
|
+
if (o.includes(t))
|
|
1841
1876
|
return c;
|
|
1842
1877
|
} catch {
|
|
1843
1878
|
console.error("Error parsing embedded override options.");
|
|
1844
1879
|
}
|
|
1845
1880
|
};
|
|
1846
|
-
function
|
|
1881
|
+
function Wr({ node: e, parent: t }, n, r) {
|
|
1847
1882
|
if (n.length === 0 || e.type !== "TemplateLiteral")
|
|
1848
1883
|
return;
|
|
1849
|
-
const
|
|
1850
|
-
if (!
|
|
1884
|
+
const o = e.comments ?? t?.comments;
|
|
1885
|
+
if (!o)
|
|
1851
1886
|
return;
|
|
1852
|
-
const c =
|
|
1887
|
+
const c = o[o.length - 1];
|
|
1853
1888
|
if (![
|
|
1854
1889
|
"MultiLine",
|
|
1855
1890
|
// meriyah
|
|
@@ -1859,16 +1894,16 @@ function Gr({ node: e, parent: t }, n, r) {
|
|
|
1859
1894
|
// babel, babel-flow, babel-ts
|
|
1860
1895
|
].includes(c.type) || !c.leading)
|
|
1861
1896
|
return;
|
|
1862
|
-
const
|
|
1897
|
+
const s = r.noEmbeddedIdentificationByComment ?? [];
|
|
1863
1898
|
for (const d of n)
|
|
1864
|
-
if (!
|
|
1899
|
+
if (!s.includes(d) && ` ${d} ` === c.value)
|
|
1865
1900
|
return d;
|
|
1866
1901
|
}
|
|
1867
|
-
function
|
|
1902
|
+
function qr({ node: e, parent: t }, n, r) {
|
|
1868
1903
|
if (n.length === 0 || e.type !== "TemplateLiteral" || t?.type !== "TaggedTemplateExpression")
|
|
1869
1904
|
return;
|
|
1870
1905
|
r.parser;
|
|
1871
|
-
const
|
|
1906
|
+
const o = r.parser in wt, c = r.noEmbeddedIdentificationByTag ?? [], s = /* @__PURE__ */ new Set([
|
|
1872
1907
|
"start",
|
|
1873
1908
|
"end",
|
|
1874
1909
|
"loc",
|
|
@@ -1879,15 +1914,15 @@ function Cr({ node: e, parent: t }, n, r) {
|
|
|
1879
1914
|
]);
|
|
1880
1915
|
for (const d of n)
|
|
1881
1916
|
if (!c.includes(d))
|
|
1882
|
-
if (
|
|
1917
|
+
if (Gr(d)) {
|
|
1883
1918
|
if (t.tag.type === "Identifier" && t.tag.name === d)
|
|
1884
1919
|
return d;
|
|
1885
1920
|
} else {
|
|
1886
|
-
if (!
|
|
1921
|
+
if (!o)
|
|
1887
1922
|
return;
|
|
1888
1923
|
let p;
|
|
1889
1924
|
try {
|
|
1890
|
-
const a =
|
|
1925
|
+
const a = wt[r.parser].parse(
|
|
1891
1926
|
`${d}\`\``,
|
|
1892
1927
|
r
|
|
1893
1928
|
);
|
|
@@ -1904,60 +1939,60 @@ function Cr({ node: e, parent: t }, n, r) {
|
|
|
1904
1939
|
const h = p.body[0]?.expression;
|
|
1905
1940
|
if (h?.type !== "TaggedTemplateExpression")
|
|
1906
1941
|
continue;
|
|
1907
|
-
if (t.tag, h.tag,
|
|
1942
|
+
if (t.tag, h.tag, pn(t.tag, h.tag, s))
|
|
1908
1943
|
return d;
|
|
1909
1944
|
}
|
|
1910
1945
|
}
|
|
1911
|
-
function
|
|
1946
|
+
function Gr(e) {
|
|
1912
1947
|
return /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(e);
|
|
1913
1948
|
}
|
|
1914
|
-
function
|
|
1915
|
-
return Object.is(e, t) ? !0 : Array.isArray(e) ?
|
|
1949
|
+
function un(e, t, n = /* @__PURE__ */ new Set()) {
|
|
1950
|
+
return Object.is(e, t) ? !0 : Array.isArray(e) ? Cr(e, t, n) : typeof e == "object" ? pn(
|
|
1916
1951
|
e,
|
|
1917
1952
|
t,
|
|
1918
1953
|
n
|
|
1919
1954
|
) : !1;
|
|
1920
1955
|
}
|
|
1921
|
-
function
|
|
1956
|
+
function Cr(e, t, n = /* @__PURE__ */ new Set()) {
|
|
1922
1957
|
const r = e.length;
|
|
1923
1958
|
if (r !== t.length)
|
|
1924
1959
|
return !1;
|
|
1925
|
-
for (let
|
|
1926
|
-
if (!
|
|
1960
|
+
for (let o = 0; o < r; o++)
|
|
1961
|
+
if (!un(e[o], t[o], n))
|
|
1927
1962
|
return !1;
|
|
1928
1963
|
return !0;
|
|
1929
1964
|
}
|
|
1930
|
-
function
|
|
1965
|
+
function pn(e, t, n = /* @__PURE__ */ new Set()) {
|
|
1931
1966
|
for (const r of Object.keys(e))
|
|
1932
|
-
if (!n.has(r) && !(Object.prototype.hasOwnProperty.call(t, r) &&
|
|
1967
|
+
if (!n.has(r) && !(Object.prototype.hasOwnProperty.call(t, r) && un(e[r], t[r], n)))
|
|
1933
1968
|
return !1;
|
|
1934
1969
|
return !0;
|
|
1935
1970
|
}
|
|
1936
|
-
const { estree:
|
|
1971
|
+
const { estree: gn } = vn, zr = (e, t) => {
|
|
1937
1972
|
const { node: n } = e;
|
|
1938
1973
|
if (n.type !== "TemplateLiteral" || n.quasis.some(({ value: { cooked: r } }) => r === null))
|
|
1939
1974
|
return null;
|
|
1940
|
-
for (const r of
|
|
1941
|
-
const
|
|
1942
|
-
if (!
|
|
1975
|
+
for (const r of rn) {
|
|
1976
|
+
const o = t[D(r)];
|
|
1977
|
+
if (!o)
|
|
1943
1978
|
continue;
|
|
1944
|
-
const c =
|
|
1979
|
+
const c = Wr(e, o, t) ?? qr(e, o, t);
|
|
1945
1980
|
if (c === void 0)
|
|
1946
1981
|
continue;
|
|
1947
|
-
const
|
|
1948
|
-
if (!
|
|
1982
|
+
const s = cn[r];
|
|
1983
|
+
if (!s)
|
|
1949
1984
|
return null;
|
|
1950
1985
|
const d = e.node;
|
|
1951
1986
|
return d.quasis.length === 1 && d.quasis[0]?.value.raw.trim() === "" ? "``" : async (p, h, a, l) => {
|
|
1952
|
-
const u = await
|
|
1987
|
+
const u = await Ur(
|
|
1953
1988
|
l.embeddedOverrides,
|
|
1954
1989
|
c,
|
|
1955
1990
|
l.filepath
|
|
1956
1991
|
);
|
|
1957
1992
|
try {
|
|
1958
|
-
const E = await
|
|
1993
|
+
const E = await s(p, h, a, l, {
|
|
1959
1994
|
identifier: c,
|
|
1960
|
-
identifiers:
|
|
1995
|
+
identifiers: o,
|
|
1961
1996
|
embeddedOverrideOptions: u
|
|
1962
1997
|
});
|
|
1963
1998
|
return $.label(
|
|
@@ -1969,15 +2004,15 @@ const { estree: pn } = yn, Jr = (e, t) => {
|
|
|
1969
2004
|
}
|
|
1970
2005
|
};
|
|
1971
2006
|
}
|
|
1972
|
-
return
|
|
1973
|
-
},
|
|
2007
|
+
return gn.embed?.(e, t) ?? null;
|
|
2008
|
+
}, ti = {
|
|
1974
2009
|
estree: {
|
|
1975
|
-
...
|
|
1976
|
-
embed:
|
|
2010
|
+
...gn,
|
|
2011
|
+
embed: zr
|
|
1977
2012
|
}
|
|
1978
2013
|
};
|
|
1979
2014
|
export {
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
2015
|
+
ei as options,
|
|
2016
|
+
wt as parsers,
|
|
2017
|
+
ti as printers
|
|
1983
2018
|
};
|