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