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