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