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