prettier-plugin-embed 0.2.3 → 0.2.5
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 +14 -0
- package/dist/embedded/index.d.ts +1 -1
- package/dist/embedded/register.d.ts +4 -4
- package/dist/index.js +380 -381
- package/package.json +6 -7
- package/README.bak +0 -211
package/dist/index.js
CHANGED
|
@@ -4,32 +4,31 @@ import ot from "prettier/parser-flow";
|
|
|
4
4
|
import at from "prettier/parser-typescript";
|
|
5
5
|
import dt from "prettier/parser-meriyah";
|
|
6
6
|
import { utils as re, builders as k } from "prettier/doc";
|
|
7
|
-
import {
|
|
8
|
-
import { printers as ct } from "prettier/plugins/estree.mjs";
|
|
7
|
+
import { printers as lt } from "prettier/plugins/estree.mjs";
|
|
9
8
|
const We = "embeddedCss";
|
|
10
|
-
function
|
|
9
|
+
function ct(e) {
|
|
11
10
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
12
11
|
}
|
|
13
12
|
var Ge = { exports: {} };
|
|
14
13
|
(function(e) {
|
|
15
14
|
var n = (() => {
|
|
16
|
-
var r = Object.defineProperty, t = Object.getOwnPropertyDescriptor, s = Object.getOwnPropertyNames, o = Object.getOwnPropertySymbols,
|
|
17
|
-
for (var
|
|
18
|
-
|
|
15
|
+
var r = Object.defineProperty, t = Object.getOwnPropertyDescriptor, s = Object.getOwnPropertyNames, o = Object.getOwnPropertySymbols, g = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable, c = (h, a, l) => a in h ? r(h, a, { enumerable: !0, configurable: !0, writable: !0, value: l }) : h[a] = l, u = (h, a) => {
|
|
16
|
+
for (var l in a || (a = {}))
|
|
17
|
+
g.call(a, l) && c(h, l, a[l]);
|
|
19
18
|
if (o)
|
|
20
|
-
for (var
|
|
21
|
-
|
|
22
|
-
return
|
|
23
|
-
},
|
|
24
|
-
for (var
|
|
25
|
-
r(
|
|
26
|
-
}, $ = (
|
|
19
|
+
for (var l of o(a))
|
|
20
|
+
m.call(a, l) && c(h, l, a[l]);
|
|
21
|
+
return h;
|
|
22
|
+
}, p = (h, a) => {
|
|
23
|
+
for (var l in a)
|
|
24
|
+
r(h, l, { get: a[l], enumerable: !0 });
|
|
25
|
+
}, $ = (h, a, l, I) => {
|
|
27
26
|
if (a && typeof a == "object" || typeof a == "function")
|
|
28
27
|
for (let E of s(a))
|
|
29
|
-
!
|
|
30
|
-
return
|
|
31
|
-
}, S = (
|
|
32
|
-
|
|
28
|
+
!g.call(h, E) && E !== l && r(h, E, { get: () => a[E], enumerable: !(I = t(a, E)) || I.enumerable });
|
|
29
|
+
return h;
|
|
30
|
+
}, S = (h) => $(r({}, "__esModule", { value: !0 }), h), i = (h, a, l) => (c(h, typeof a != "symbol" ? a + "" : a, l), l), f = {};
|
|
31
|
+
p(f, {
|
|
33
32
|
DEFAULT_OPTIONS: () => L,
|
|
34
33
|
DEFAULT_UUID_LENGTH: () => v,
|
|
35
34
|
default: () => y
|
|
@@ -40,7 +39,7 @@ var Ge = { exports: {} };
|
|
|
40
39
|
debug: !1,
|
|
41
40
|
length: v,
|
|
42
41
|
counter: 0
|
|
43
|
-
},
|
|
42
|
+
}, _ = class {
|
|
44
43
|
constructor(a = {}) {
|
|
45
44
|
i(this, "counter"), i(this, "debug"), i(this, "dict"), i(this, "version"), i(this, "dictIndex", 0), i(this, "dictRange", []), i(this, "lowerBound", 0), i(this, "upperBound", 0), i(this, "dictLength", 0), i(this, "uuidLength"), i(this, "_digit_first_ascii", 48), i(this, "_digit_last_ascii", 58), i(this, "_alpha_lower_first_ascii", 97), i(this, "_alpha_lower_last_ascii", 123), i(this, "_hex_last_ascii", 103), i(this, "_alpha_upper_first_ascii", 65), i(this, "_alpha_upper_last_ascii", 91), i(this, "_number_dict_ranges", {
|
|
46
45
|
digits: [this._digit_first_ascii, this._digit_last_ascii]
|
|
@@ -73,19 +72,19 @@ var Ge = { exports: {} };
|
|
|
73
72
|
_alphanum_lower_dict_ranges: this._alphanum_lower_dict_ranges,
|
|
74
73
|
_alphanum_upper_dict_ranges: this._alphanum_upper_dict_ranges,
|
|
75
74
|
_hex_dict_ranges: this._hex_dict_ranges
|
|
76
|
-
}), i(this, "log", (...
|
|
77
|
-
const x = [...
|
|
78
|
-
if (x[0] = `[short-unique-id] ${
|
|
75
|
+
}), i(this, "log", (...d) => {
|
|
76
|
+
const x = [...d];
|
|
77
|
+
if (x[0] = `[short-unique-id] ${d[0]}`, this.debug === !0 && typeof console < "u" && console !== null)
|
|
79
78
|
return console.log(...x);
|
|
80
|
-
}), i(this, "setDictionary", (
|
|
79
|
+
}), i(this, "setDictionary", (d, x) => {
|
|
81
80
|
let w;
|
|
82
|
-
if (
|
|
83
|
-
w =
|
|
81
|
+
if (d && Array.isArray(d) && d.length > 1)
|
|
82
|
+
w = d;
|
|
84
83
|
else {
|
|
85
84
|
w = [];
|
|
86
85
|
let T;
|
|
87
86
|
this.dictIndex = T = 0;
|
|
88
|
-
const P = `_${
|
|
87
|
+
const P = `_${d}_dict_ranges`, U = this._dict_ranges[P];
|
|
89
88
|
Object.keys(U).forEach((N) => {
|
|
90
89
|
const te = N;
|
|
91
90
|
for (this.dictRange = U[te], this.lowerBound = this.dictRange[0], this.upperBound = this.dictRange[1], this.dictIndex = T = this.lowerBound; this.lowerBound <= this.upperBound ? T < this.upperBound : T > this.upperBound; this.dictIndex = this.lowerBound <= this.upperBound ? T += 1 : T -= 1)
|
|
@@ -94,51 +93,51 @@ var Ge = { exports: {} };
|
|
|
94
93
|
}
|
|
95
94
|
x && (w = w.sort(() => Math.random() - 0.5)), this.dict = w, this.dictLength = this.dict.length, this.setCounter(0);
|
|
96
95
|
}), i(this, "seq", () => this.sequentialUUID()), i(this, "sequentialUUID", () => {
|
|
97
|
-
let
|
|
98
|
-
|
|
96
|
+
let d, x, w = "";
|
|
97
|
+
d = this.counter;
|
|
99
98
|
do
|
|
100
|
-
x =
|
|
101
|
-
while (
|
|
99
|
+
x = d % this.dictLength, d = Math.trunc(d / this.dictLength), w += this.dict[x];
|
|
100
|
+
while (d !== 0);
|
|
102
101
|
return this.counter += 1, w;
|
|
103
|
-
}), i(this, "rnd", (
|
|
102
|
+
}), i(this, "rnd", (d = this.uuidLength || v) => this.randomUUID(d)), i(this, "randomUUID", (d = this.uuidLength || v) => {
|
|
104
103
|
let x, w, T;
|
|
105
|
-
if (
|
|
104
|
+
if (d === null || typeof d > "u" || d < 1)
|
|
106
105
|
throw new Error("Invalid UUID Length Provided");
|
|
107
|
-
for (x = "", T = 0; T <
|
|
106
|
+
for (x = "", T = 0; T < d; T += 1)
|
|
108
107
|
w = parseInt(
|
|
109
108
|
(Math.random() * this.dictLength).toFixed(0),
|
|
110
109
|
10
|
|
111
110
|
) % this.dictLength, x += this.dict[w];
|
|
112
111
|
return x;
|
|
113
|
-
}), i(this, "fmt", (
|
|
112
|
+
}), i(this, "fmt", (d, x) => this.formattedUUID(d, x)), i(this, "formattedUUID", (d, x) => {
|
|
114
113
|
const w = {
|
|
115
114
|
$r: this.randomUUID,
|
|
116
115
|
$s: this.sequentialUUID,
|
|
117
116
|
$t: this.stamp
|
|
118
117
|
};
|
|
119
|
-
return
|
|
118
|
+
return d.replace(
|
|
120
119
|
/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
|
|
121
120
|
(P) => {
|
|
122
121
|
const U = P.slice(0, 2), N = parseInt(P.slice(2), 10);
|
|
123
122
|
return U === "$s" ? w[U]().padStart(N, "0") : U === "$t" && x ? w[U](N, x) : w[U](N);
|
|
124
123
|
}
|
|
125
124
|
);
|
|
126
|
-
}), i(this, "availableUUIDs", (
|
|
127
|
-
Math.pow([...new Set(this.dict)].length,
|
|
128
|
-
)), i(this, "approxMaxBeforeCollision", (
|
|
129
|
-
Math.sqrt(Math.PI / 2 *
|
|
130
|
-
)), i(this, "collisionProbability", (
|
|
131
|
-
(this.approxMaxBeforeCollision(
|
|
132
|
-
)), i(this, "uniqueness", (
|
|
125
|
+
}), i(this, "availableUUIDs", (d = this.uuidLength) => parseFloat(
|
|
126
|
+
Math.pow([...new Set(this.dict)].length, d).toFixed(0)
|
|
127
|
+
)), i(this, "approxMaxBeforeCollision", (d = this.availableUUIDs(this.uuidLength)) => parseFloat(
|
|
128
|
+
Math.sqrt(Math.PI / 2 * d).toFixed(20)
|
|
129
|
+
)), i(this, "collisionProbability", (d = this.availableUUIDs(this.uuidLength), x = this.uuidLength) => parseFloat(
|
|
130
|
+
(this.approxMaxBeforeCollision(d) / this.availableUUIDs(x)).toFixed(20)
|
|
131
|
+
)), i(this, "uniqueness", (d = this.availableUUIDs(this.uuidLength)) => {
|
|
133
132
|
const x = parseFloat(
|
|
134
|
-
(1 - this.approxMaxBeforeCollision(
|
|
133
|
+
(1 - this.approxMaxBeforeCollision(d) / d).toFixed(20)
|
|
135
134
|
);
|
|
136
135
|
return x > 1 ? 1 : x < 0 ? 0 : x;
|
|
137
|
-
}), i(this, "getVersion", () => this.version), i(this, "stamp", (
|
|
136
|
+
}), i(this, "getVersion", () => this.version), i(this, "stamp", (d, x) => {
|
|
138
137
|
const w = Math.floor(+(x || /* @__PURE__ */ new Date()) / 1e3).toString(16);
|
|
139
|
-
if (typeof
|
|
138
|
+
if (typeof d == "number" && d === 0)
|
|
140
139
|
return w;
|
|
141
|
-
if (typeof
|
|
140
|
+
if (typeof d != "number" || d < 10)
|
|
142
141
|
throw new Error(
|
|
143
142
|
[
|
|
144
143
|
"Param finalLength must be a number greater than or equal to 10,",
|
|
@@ -146,9 +145,9 @@ var Ge = { exports: {} };
|
|
|
146
145
|
].join(`
|
|
147
146
|
`)
|
|
148
147
|
);
|
|
149
|
-
const T =
|
|
148
|
+
const T = d - 9, P = Math.round(Math.random() * (T > 15 ? 15 : T)), U = this.randomUUID(T);
|
|
150
149
|
return `${U.substring(0, P)}${w}${U.substring(P)}${P.toString(16)}`;
|
|
151
|
-
}), i(this, "parseStamp", (
|
|
150
|
+
}), i(this, "parseStamp", (d, x) => {
|
|
152
151
|
if (x && !/t0|t[1-9]\d{1,}/.test(x))
|
|
153
152
|
throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");
|
|
154
153
|
const w = x ? x.replace(
|
|
@@ -163,64 +162,64 @@ var Ge = { exports: {} };
|
|
|
163
162
|
}
|
|
164
163
|
).replace(
|
|
165
164
|
/^(.*?)(t{8,})(.*)$/g,
|
|
166
|
-
(P, U, N) =>
|
|
167
|
-
) :
|
|
165
|
+
(P, U, N) => d.substring(U.length, U.length + N.length)
|
|
166
|
+
) : d;
|
|
168
167
|
if (w.length === 8)
|
|
169
168
|
return new Date(parseInt(w, 16) * 1e3);
|
|
170
169
|
if (w.length < 10)
|
|
171
170
|
throw new Error("Stamp length invalid");
|
|
172
171
|
const T = parseInt(w.substring(w.length - 1), 16);
|
|
173
172
|
return new Date(parseInt(w.substring(T, T + 8), 16) * 1e3);
|
|
174
|
-
}), i(this, "setCounter", (
|
|
175
|
-
this.counter =
|
|
173
|
+
}), i(this, "setCounter", (d) => {
|
|
174
|
+
this.counter = d;
|
|
176
175
|
});
|
|
177
|
-
const
|
|
176
|
+
const l = u(u({}, L), a);
|
|
178
177
|
this.counter = 0, this.debug = !1, this.dict = [], this.version = b;
|
|
179
178
|
const {
|
|
180
179
|
dictionary: I,
|
|
181
180
|
shuffle: E,
|
|
182
181
|
length: D,
|
|
183
182
|
counter: O
|
|
184
|
-
} =
|
|
185
|
-
return this.uuidLength = D, this.setDictionary(I, E), this.setCounter(O), this.debug =
|
|
183
|
+
} = l;
|
|
184
|
+
return this.uuidLength = D, this.setDictionary(I, E), this.setCounter(O), this.debug = l.debug, this.log(this.dict), this.log(
|
|
186
185
|
`Generator instantiated with Dictionary Size ${this.dictLength} and counter set to ${this.counter}`
|
|
187
186
|
), this.log = this.log.bind(this), this.setDictionary = this.setDictionary.bind(this), this.setCounter = this.setCounter.bind(this), this.seq = this.seq.bind(this), this.sequentialUUID = this.sequentialUUID.bind(this), this.rnd = this.rnd.bind(this), this.randomUUID = this.randomUUID.bind(this), this.fmt = this.fmt.bind(this), this.formattedUUID = this.formattedUUID.bind(this), this.availableUUIDs = this.availableUUIDs.bind(this), this.approxMaxBeforeCollision = this.approxMaxBeforeCollision.bind(this), this.collisionProbability = this.collisionProbability.bind(this), this.uniqueness = this.uniqueness.bind(this), this.getVersion = this.getVersion.bind(this), this.stamp = this.stamp.bind(this), this.parseStamp = this.parseStamp.bind(this), this;
|
|
188
187
|
}
|
|
189
188
|
};
|
|
190
|
-
i(
|
|
191
|
-
var y =
|
|
192
|
-
return S(
|
|
189
|
+
i(_, "default", _);
|
|
190
|
+
var y = _;
|
|
191
|
+
return S(f);
|
|
193
192
|
})();
|
|
194
193
|
e.exports = n.default, typeof window < "u" && (n = n.default);
|
|
195
194
|
})(Ge);
|
|
196
|
-
var
|
|
197
|
-
const
|
|
198
|
-
function
|
|
195
|
+
var ut = Ge.exports;
|
|
196
|
+
const pt = /* @__PURE__ */ ct(ut), { group: ht, indent: gt, softline: le, lineSuffixBoundary: mt } = k, { mapDoc: _t } = re;
|
|
197
|
+
function ft(e, n) {
|
|
199
198
|
var s;
|
|
200
199
|
const { node: r } = e;
|
|
201
200
|
let t = n();
|
|
202
|
-
return (s = r == null ? void 0 : r.comments) != null && s.length && (t =
|
|
201
|
+
return (s = r == null ? void 0 : r.comments) != null && s.length && (t = ht([gt([le, t]), le])), ["${", t, mt, "}"];
|
|
203
202
|
}
|
|
204
203
|
function M(e, n) {
|
|
205
204
|
return e.map(
|
|
206
|
-
(r) =>
|
|
205
|
+
(r) => ft(r, n),
|
|
207
206
|
"expressions"
|
|
208
207
|
);
|
|
209
208
|
}
|
|
210
209
|
function q(e, n, r) {
|
|
211
|
-
return
|
|
210
|
+
return _t(e, (s) => {
|
|
212
211
|
if (typeof s != "string")
|
|
213
212
|
return s;
|
|
214
|
-
const o = [],
|
|
215
|
-
for (let
|
|
216
|
-
let
|
|
217
|
-
if (
|
|
218
|
-
if (!
|
|
213
|
+
const o = [], g = s.split(n);
|
|
214
|
+
for (let m = 0; m < g.length; m++) {
|
|
215
|
+
let c = g[m];
|
|
216
|
+
if (m % 2 == 0) {
|
|
217
|
+
if (!c)
|
|
219
218
|
continue;
|
|
220
|
-
|
|
219
|
+
c = c.replaceAll(/([\\`]|\${)/g, "\\$1"), o.push(c);
|
|
221
220
|
} else {
|
|
222
|
-
const
|
|
223
|
-
o.push(r[
|
|
221
|
+
const u = Number(c);
|
|
222
|
+
o.push(r[u]);
|
|
224
223
|
}
|
|
225
224
|
}
|
|
226
225
|
return o;
|
|
@@ -238,7 +237,7 @@ function Q(e, n, r) {
|
|
|
238
237
|
`Cannot format embedded language identified by "${r}", because plugin "${e}" is not loaded.`
|
|
239
238
|
);
|
|
240
239
|
}
|
|
241
|
-
function
|
|
240
|
+
function bt(e, n, r) {
|
|
242
241
|
if (n === r) {
|
|
243
242
|
e.unshift(n);
|
|
244
243
|
return;
|
|
@@ -254,18 +253,18 @@ function yt(e, n, r) {
|
|
|
254
253
|
}
|
|
255
254
|
e.splice(t, 0, n);
|
|
256
255
|
}
|
|
257
|
-
const { randomUUID: ce } = new
|
|
256
|
+
const { randomUUID: ce } = new pt({
|
|
258
257
|
length: 16,
|
|
259
258
|
dictionary: "alphanum_lower"
|
|
260
259
|
});
|
|
261
260
|
function j(e = "p", n = "") {
|
|
262
|
-
const r = ce(), t = ce(), s = ue(e), o = ue(n),
|
|
261
|
+
const r = ce(), t = ce(), s = ue(e), o = ue(n), g = (c) => `${e}${r}${c}${t}${n}`, m = new RegExp(
|
|
263
262
|
`${s}${r}(\\d+)${t}${o}`,
|
|
264
263
|
"g"
|
|
265
264
|
);
|
|
266
265
|
return {
|
|
267
|
-
createPlaceholder:
|
|
268
|
-
placeholderRegex:
|
|
266
|
+
createPlaceholder: g,
|
|
267
|
+
placeholderRegex: m
|
|
269
268
|
};
|
|
270
269
|
}
|
|
271
270
|
function ue(e) {
|
|
@@ -274,83 +273,83 @@ function ue(e) {
|
|
|
274
273
|
function R(e) {
|
|
275
274
|
return `${e}Identifiers`;
|
|
276
275
|
}
|
|
277
|
-
function
|
|
276
|
+
function yt(e) {
|
|
278
277
|
return `${e}Parser`;
|
|
279
278
|
}
|
|
280
|
-
const { line: pe, group: B, indent: he, softline: ge } = k,
|
|
281
|
-
var o,
|
|
279
|
+
const { line: pe, group: B, indent: he, softline: ge } = k, It = async (e, n, r, t, s) => {
|
|
280
|
+
var o, g, m, c, u;
|
|
282
281
|
try {
|
|
283
|
-
const { node:
|
|
284
|
-
(a,
|
|
285
|
-
).join(""),
|
|
282
|
+
const { node: p } = r, { createPlaceholder: $, placeholderRegex: S } = j("@p"), i = p.quasis.map(
|
|
283
|
+
(a, l, { length: I }) => l === I - 1 ? a.value.cooked : a.value.cooked + $(l)
|
|
284
|
+
).join(""), f = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((g = i.match(/\s+$/)) == null ? void 0 : g[0]) ?? "", v = M(r, n), L = await e(i, {
|
|
286
285
|
parser: "scss"
|
|
287
|
-
}),
|
|
286
|
+
}), _ = q(
|
|
288
287
|
L,
|
|
289
288
|
S,
|
|
290
289
|
v
|
|
291
290
|
);
|
|
292
|
-
if ((
|
|
291
|
+
if ((m = t.preserveEmbeddedExteriorWhitespaces) != null && m.includes(s))
|
|
293
292
|
return B([
|
|
294
293
|
"`",
|
|
295
|
-
|
|
296
|
-
(
|
|
294
|
+
f,
|
|
295
|
+
(c = t.noEmbeddedMultiLineIndentation) != null && c.includes(s) ? [B(_)] : he([B(_)]),
|
|
297
296
|
b,
|
|
298
297
|
"`"
|
|
299
298
|
]);
|
|
300
|
-
const y =
|
|
299
|
+
const y = f.length ? pe : ge, h = b.length ? pe : ge;
|
|
301
300
|
return B([
|
|
302
301
|
"`",
|
|
303
|
-
(
|
|
304
|
-
|
|
302
|
+
(u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [y, B(_)] : he([y, B(_)]),
|
|
303
|
+
h,
|
|
305
304
|
"`"
|
|
306
305
|
]);
|
|
307
|
-
} catch (
|
|
308
|
-
throw console.error(
|
|
306
|
+
} catch (p) {
|
|
307
|
+
throw console.error(p), p;
|
|
309
308
|
}
|
|
310
|
-
},
|
|
311
|
-
[
|
|
309
|
+
}, Et = ["css"], xt = R(We), $t = {
|
|
310
|
+
[xt]: {
|
|
312
311
|
category: "Global",
|
|
313
312
|
type: "string",
|
|
314
313
|
array: !0,
|
|
315
|
-
default: [{ value: [...
|
|
314
|
+
default: [{ value: [...Et] }],
|
|
316
315
|
description: "Specify embedded CSS language identifiers."
|
|
317
316
|
}
|
|
318
|
-
},
|
|
317
|
+
}, vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
319
318
|
__proto__: null,
|
|
320
319
|
embeddedLanguage: We,
|
|
321
|
-
embedder:
|
|
322
|
-
options:
|
|
323
|
-
}, Symbol.toStringTag, { value: "Module" })), ie = "embeddedEs", { line: me, group: F, indent: _e, softline: fe } = k,
|
|
324
|
-
var o,
|
|
320
|
+
embedder: It,
|
|
321
|
+
options: $t
|
|
322
|
+
}, Symbol.toStringTag, { value: "Module" })), ie = "embeddedEs", { line: me, group: F, indent: _e, softline: fe } = k, wt = async (e, n, r, t, s) => {
|
|
323
|
+
var o, g, m, c, u;
|
|
325
324
|
try {
|
|
326
|
-
const { node:
|
|
327
|
-
(a,
|
|
328
|
-
).join(""),
|
|
325
|
+
const { node: p } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = p.quasis.map(
|
|
326
|
+
(a, l, { length: I }) => l === I - 1 ? a.value.cooked : a.value.cooked + $(l)
|
|
327
|
+
).join(""), f = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((g = i.match(/\s+$/)) == null ? void 0 : g[0]) ?? "", v = M(r, n), L = await e(i, {
|
|
329
328
|
parser: t.embeddedEsParser ?? "babel"
|
|
330
|
-
}),
|
|
329
|
+
}), _ = q(
|
|
331
330
|
L,
|
|
332
331
|
S,
|
|
333
332
|
v
|
|
334
333
|
);
|
|
335
|
-
if ((
|
|
334
|
+
if ((m = t.preserveEmbeddedExteriorWhitespaces) != null && m.includes(s))
|
|
336
335
|
return F([
|
|
337
336
|
"`",
|
|
338
|
-
|
|
339
|
-
(
|
|
337
|
+
f,
|
|
338
|
+
(c = t.noEmbeddedMultiLineIndentation) != null && c.includes(s) ? [F(_)] : _e([F(_)]),
|
|
340
339
|
b,
|
|
341
340
|
"`"
|
|
342
341
|
]);
|
|
343
|
-
const y =
|
|
342
|
+
const y = f.length ? me : fe, h = b.length ? me : fe;
|
|
344
343
|
return F([
|
|
345
344
|
"`",
|
|
346
|
-
(
|
|
347
|
-
|
|
345
|
+
(u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [y, F(_)] : _e([y, F(_)]),
|
|
346
|
+
h,
|
|
348
347
|
"`"
|
|
349
348
|
]);
|
|
350
|
-
} catch (
|
|
351
|
-
throw console.error(
|
|
349
|
+
} catch (p) {
|
|
350
|
+
throw console.error(p), p;
|
|
352
351
|
}
|
|
353
|
-
},
|
|
352
|
+
}, Dt = [
|
|
354
353
|
"js",
|
|
355
354
|
"jsx",
|
|
356
355
|
"es",
|
|
@@ -359,61 +358,61 @@ const { line: pe, group: B, indent: he, softline: ge } = k, Et = async (e, n, r,
|
|
|
359
358
|
"cjs",
|
|
360
359
|
"pac",
|
|
361
360
|
"javascript"
|
|
362
|
-
],
|
|
363
|
-
[
|
|
361
|
+
], Lt = R(ie), St = yt(ie), Tt = {
|
|
362
|
+
[Lt]: {
|
|
364
363
|
category: "Global",
|
|
365
364
|
type: "string",
|
|
366
365
|
array: !0,
|
|
367
|
-
default: [{ value: [...
|
|
366
|
+
default: [{ value: [...Dt] }],
|
|
368
367
|
description: "Specify embedded ES language identifiers."
|
|
369
368
|
},
|
|
370
|
-
[
|
|
369
|
+
[St]: {
|
|
371
370
|
category: "Global",
|
|
372
371
|
type: "string",
|
|
373
372
|
array: !1,
|
|
374
373
|
default: "babel",
|
|
375
374
|
description: "Specify the embedded ES language parser."
|
|
376
375
|
}
|
|
377
|
-
},
|
|
376
|
+
}, Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
378
377
|
__proto__: null,
|
|
379
378
|
embeddedLanguage: ie,
|
|
380
|
-
embedder:
|
|
381
|
-
options:
|
|
382
|
-
}, Symbol.toStringTag, { value: "Module" })), ze = "embeddedGlsl", { line: be, group: A, indent: ye, softline: Ie } = k,
|
|
383
|
-
var o,
|
|
379
|
+
embedder: wt,
|
|
380
|
+
options: Tt
|
|
381
|
+
}, Symbol.toStringTag, { value: "Module" })), ze = "embeddedGlsl", { line: be, group: A, indent: ye, softline: Ie } = k, Ut = async (e, n, r, t, s) => {
|
|
382
|
+
var o, g, m, c, u;
|
|
384
383
|
try {
|
|
385
384
|
Q("prettier-plugin-glsl", t, s);
|
|
386
|
-
const { node:
|
|
387
|
-
(
|
|
388
|
-
).join(""),
|
|
389
|
-
|
|
385
|
+
const { node: p } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = p.quasis.map(
|
|
386
|
+
(l, I, { length: E }) => I === E - 1 ? l.value.cooked : l.value.cooked + $(I)
|
|
387
|
+
).join(""), f = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((g = i.match(/\s+$/)) == null ? void 0 : g[0]) ?? "", v = i.slice(
|
|
388
|
+
f.length,
|
|
390
389
|
-b.length || void 0
|
|
391
|
-
), L = M(r, n),
|
|
390
|
+
), L = M(r, n), _ = await e(v, {
|
|
392
391
|
parser: "glsl-parser"
|
|
393
392
|
}), y = q(
|
|
394
|
-
|
|
393
|
+
_,
|
|
395
394
|
S,
|
|
396
395
|
L
|
|
397
396
|
);
|
|
398
|
-
if ((
|
|
397
|
+
if ((m = t.preserveEmbeddedExteriorWhitespaces) != null && m.includes(s))
|
|
399
398
|
return A([
|
|
400
399
|
"`",
|
|
401
|
-
|
|
402
|
-
(
|
|
400
|
+
f,
|
|
401
|
+
(c = t.noEmbeddedMultiLineIndentation) != null && c.includes(s) ? [A(y)] : ye([A(y)]),
|
|
403
402
|
b,
|
|
404
403
|
"`"
|
|
405
404
|
]);
|
|
406
|
-
const
|
|
405
|
+
const h = f.length ? be : Ie, a = b.length ? be : Ie;
|
|
407
406
|
return A([
|
|
408
407
|
"`",
|
|
409
|
-
(
|
|
408
|
+
(u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [h, A(y)] : ye([h, A(y)]),
|
|
410
409
|
a,
|
|
411
410
|
"`"
|
|
412
411
|
]);
|
|
413
|
-
} catch (
|
|
414
|
-
throw console.error(
|
|
412
|
+
} catch (p) {
|
|
413
|
+
throw console.error(p), p;
|
|
415
414
|
}
|
|
416
|
-
},
|
|
415
|
+
}, Pt = [
|
|
417
416
|
"glsl",
|
|
418
417
|
"fp",
|
|
419
418
|
"frag",
|
|
@@ -436,63 +435,63 @@ const { line: pe, group: B, indent: he, softline: ge } = k, Et = async (e, n, r,
|
|
|
436
435
|
"vrx",
|
|
437
436
|
"vsh",
|
|
438
437
|
"vshader"
|
|
439
|
-
],
|
|
440
|
-
[
|
|
438
|
+
], kt = R(ze), Rt = {
|
|
439
|
+
[kt]: {
|
|
441
440
|
category: "Global",
|
|
442
441
|
type: "string",
|
|
443
442
|
array: !0,
|
|
444
|
-
default: [{ value: [...
|
|
443
|
+
default: [{ value: [...Pt] }],
|
|
445
444
|
description: 'Specify embedded GLSL language identifiers. This requires "prettier-plugin-glsl".'
|
|
446
445
|
}
|
|
447
|
-
},
|
|
446
|
+
}, Mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
448
447
|
__proto__: null,
|
|
449
448
|
embeddedLanguage: ze,
|
|
450
|
-
embedder:
|
|
451
|
-
options:
|
|
452
|
-
}, Symbol.toStringTag, { value: "Module" })), Xe = "embeddedHtml", { line: Ee, group: C, indent: xe, softline: $e } = k, { mapDoc:
|
|
453
|
-
var o,
|
|
449
|
+
embedder: Ut,
|
|
450
|
+
options: Rt
|
|
451
|
+
}, Symbol.toStringTag, { value: "Module" })), Xe = "embeddedHtml", { line: Ee, group: C, indent: xe, softline: $e } = k, { mapDoc: jt } = re, Nt = async (e, n, r, t, s) => {
|
|
452
|
+
var o, g, m, c, u;
|
|
454
453
|
try {
|
|
455
|
-
const { node:
|
|
456
|
-
(a,
|
|
457
|
-
).join(""),
|
|
454
|
+
const { node: p } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = p.quasis.map(
|
|
455
|
+
(a, l, { length: I }) => l === I - 1 ? a.value.cooked : a.value.cooked + $(l)
|
|
456
|
+
).join(""), f = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((g = i.match(/\s+$/)) == null ? void 0 : g[0]) ?? "", v = M(r, n), L = await e(i, {
|
|
458
457
|
parser: "html"
|
|
459
|
-
}),
|
|
458
|
+
}), _ = jt(L, (a) => {
|
|
460
459
|
if (typeof a != "string")
|
|
461
460
|
return a;
|
|
462
|
-
const
|
|
461
|
+
const l = [], I = a.split(S);
|
|
463
462
|
for (let E = 0; E < I.length; E++) {
|
|
464
463
|
let D = I[E];
|
|
465
464
|
if (E % 2 == 0) {
|
|
466
465
|
if (!D)
|
|
467
466
|
continue;
|
|
468
|
-
D = D.replaceAll(/([\\`]|\${)/g, "\\$1"), t.__embeddedInHtml && (D = D.replaceAll(/<\/(?=script\b)/gi, "<\\/")),
|
|
467
|
+
D = D.replaceAll(/([\\`]|\${)/g, "\\$1"), t.__embeddedInHtml && (D = D.replaceAll(/<\/(?=script\b)/gi, "<\\/")), l.push(D);
|
|
469
468
|
} else {
|
|
470
469
|
const O = Number(D);
|
|
471
|
-
|
|
470
|
+
l.push(v[O]);
|
|
472
471
|
}
|
|
473
472
|
}
|
|
474
|
-
return
|
|
473
|
+
return l;
|
|
475
474
|
});
|
|
476
475
|
if (t.htmlWhitespaceSensitivity === "strict" || // TODO: is css mode should be included here?
|
|
477
|
-
t.htmlWhitespaceSensitivity === "css" || (
|
|
476
|
+
t.htmlWhitespaceSensitivity === "css" || (m = t.preserveEmbeddedExteriorWhitespaces) != null && m.includes(s))
|
|
478
477
|
return C([
|
|
479
478
|
"`",
|
|
480
|
-
|
|
481
|
-
(
|
|
479
|
+
f,
|
|
480
|
+
(c = t.noEmbeddedMultiLineIndentation) != null && c.includes(s) ? [C(_)] : xe([C(_)]),
|
|
482
481
|
b,
|
|
483
482
|
"`"
|
|
484
483
|
]);
|
|
485
|
-
const y =
|
|
484
|
+
const y = f.length ? Ee : $e, h = b.length ? Ee : $e;
|
|
486
485
|
return C([
|
|
487
486
|
"`",
|
|
488
|
-
(
|
|
489
|
-
|
|
487
|
+
(u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [y, C(_)] : xe([y, C(_)]),
|
|
488
|
+
h,
|
|
490
489
|
"`"
|
|
491
490
|
]);
|
|
492
|
-
} catch (
|
|
493
|
-
throw console.error(
|
|
491
|
+
} catch (p) {
|
|
492
|
+
throw console.error(p), p;
|
|
494
493
|
}
|
|
495
|
-
},
|
|
494
|
+
}, qt = [
|
|
496
495
|
"html",
|
|
497
496
|
"htm",
|
|
498
497
|
"shtml",
|
|
@@ -505,51 +504,51 @@ const { line: pe, group: B, indent: he, softline: ge } = k, Et = async (e, n, r,
|
|
|
505
504
|
"jshtm",
|
|
506
505
|
"volt",
|
|
507
506
|
"rhtml"
|
|
508
|
-
],
|
|
509
|
-
[
|
|
507
|
+
], Bt = R(Xe), Ft = {
|
|
508
|
+
[Bt]: {
|
|
510
509
|
category: "Global",
|
|
511
510
|
type: "string",
|
|
512
511
|
array: !0,
|
|
513
|
-
default: [{ value: [...
|
|
512
|
+
default: [{ value: [...qt] }],
|
|
514
513
|
description: "Specify embedded HTML language identifiers."
|
|
515
514
|
}
|
|
516
|
-
},
|
|
515
|
+
}, At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
517
516
|
__proto__: null,
|
|
518
517
|
embeddedLanguage: Xe,
|
|
519
|
-
embedder:
|
|
520
|
-
options:
|
|
521
|
-
}, Symbol.toStringTag, { value: "Module" })), He = "embeddedMarkdown", { line: ve, group: W, indent: we, softline: De } = k,
|
|
522
|
-
var o,
|
|
518
|
+
embedder: Nt,
|
|
519
|
+
options: Ft
|
|
520
|
+
}, Symbol.toStringTag, { value: "Module" })), He = "embeddedMarkdown", { line: ve, group: W, indent: we, softline: De } = k, Ct = async (e, n, r, t, s) => {
|
|
521
|
+
var o, g, m, c, u;
|
|
523
522
|
try {
|
|
524
|
-
const { node:
|
|
525
|
-
(a,
|
|
526
|
-
).join(""),
|
|
523
|
+
const { node: p } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = p.quasis.map(
|
|
524
|
+
(a, l, { length: I }) => l === I - 1 ? a.value.cooked : a.value.cooked + $(l)
|
|
525
|
+
).join(""), f = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((g = i.match(/\s+$/)) == null ? void 0 : g[0]) ?? "", v = M(r, n), L = await e(i, {
|
|
527
526
|
parser: "markdown",
|
|
528
527
|
__inJsTemplate: !0
|
|
529
|
-
}),
|
|
528
|
+
}), _ = q(
|
|
530
529
|
L,
|
|
531
530
|
S,
|
|
532
531
|
v
|
|
533
532
|
);
|
|
534
|
-
if ((
|
|
533
|
+
if ((m = t.preserveEmbeddedExteriorWhitespaces) != null && m.includes(s))
|
|
535
534
|
return W([
|
|
536
535
|
"`",
|
|
537
|
-
|
|
538
|
-
(
|
|
536
|
+
f,
|
|
537
|
+
(c = t.noEmbeddedMultiLineIndentation) != null && c.includes(s) ? [W(_)] : we([W(_)]),
|
|
539
538
|
b,
|
|
540
539
|
"`"
|
|
541
540
|
]);
|
|
542
|
-
const y =
|
|
541
|
+
const y = f.length ? ve : De, h = b.length ? ve : De;
|
|
543
542
|
return W([
|
|
544
543
|
"`",
|
|
545
|
-
(
|
|
546
|
-
|
|
544
|
+
(u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [y, W(_)] : we([y, W(_)]),
|
|
545
|
+
h,
|
|
547
546
|
"`"
|
|
548
547
|
]);
|
|
549
|
-
} catch (
|
|
550
|
-
throw console.error(
|
|
548
|
+
} catch (p) {
|
|
549
|
+
throw console.error(p), p;
|
|
551
550
|
}
|
|
552
|
-
},
|
|
551
|
+
}, Wt = [
|
|
553
552
|
"md",
|
|
554
553
|
"livemd",
|
|
555
554
|
"markdown",
|
|
@@ -561,78 +560,78 @@ const { line: pe, group: B, indent: he, softline: ge } = k, Et = async (e, n, r,
|
|
|
561
560
|
"ronn",
|
|
562
561
|
"scd",
|
|
563
562
|
"workbook"
|
|
564
|
-
],
|
|
565
|
-
[
|
|
563
|
+
], Gt = R(He), zt = {
|
|
564
|
+
[Gt]: {
|
|
566
565
|
category: "Global",
|
|
567
566
|
type: "string",
|
|
568
567
|
array: !0,
|
|
569
|
-
default: [{ value: [...
|
|
568
|
+
default: [{ value: [...Wt] }],
|
|
570
569
|
description: "Specify embedded Markdown language identifiers."
|
|
571
570
|
}
|
|
572
|
-
},
|
|
571
|
+
}, Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
573
572
|
__proto__: null,
|
|
574
573
|
embeddedLanguage: He,
|
|
575
|
-
embedder:
|
|
576
|
-
options:
|
|
577
|
-
}, Symbol.toStringTag, { value: "Module" })), oe = "embeddedNoop",
|
|
578
|
-
[
|
|
574
|
+
embedder: Ct,
|
|
575
|
+
options: zt
|
|
576
|
+
}, Symbol.toStringTag, { value: "Module" })), oe = "embeddedNoop", Ht = R(oe), Vt = {
|
|
577
|
+
[Ht]: {
|
|
579
578
|
category: "Global",
|
|
580
579
|
type: "string",
|
|
581
580
|
array: !0,
|
|
582
581
|
default: [{ value: [] }],
|
|
583
582
|
description: "Specify embedded language identifiers that will not be formatted."
|
|
584
583
|
}
|
|
585
|
-
},
|
|
584
|
+
}, Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
586
585
|
__proto__: null,
|
|
587
586
|
embeddedLanguage: oe,
|
|
588
|
-
options:
|
|
589
|
-
}, Symbol.toStringTag, { value: "Module" })), Ve = "embeddedPhp", { line: Le, group: G, indent: Se, softline: Te } = k,
|
|
590
|
-
var o,
|
|
587
|
+
options: Vt
|
|
588
|
+
}, Symbol.toStringTag, { value: "Module" })), Ve = "embeddedPhp", { line: Le, group: G, indent: Se, softline: Te } = k, Qt = async (e, n, r, t, s) => {
|
|
589
|
+
var o, g, m, c, u;
|
|
591
590
|
try {
|
|
592
591
|
Q("@prettier/plugin-php", t, s);
|
|
593
|
-
const { node:
|
|
594
|
-
(
|
|
595
|
-
).join(""),
|
|
596
|
-
|
|
592
|
+
const { node: p } = r, { createPlaceholder: $, placeholderRegex: S } = j("$p"), i = p.quasis.map(
|
|
593
|
+
(l, I, { length: E }) => I === E - 1 ? l.value.cooked : l.value.cooked + $(I)
|
|
594
|
+
).join(""), f = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((g = i.match(/\s+$/)) == null ? void 0 : g[0]) ?? "", v = i.slice(
|
|
595
|
+
f.length,
|
|
597
596
|
-b.length || void 0
|
|
598
|
-
), L = M(r, n),
|
|
597
|
+
), L = M(r, n), _ = await e(v, {
|
|
599
598
|
parser: "php"
|
|
600
599
|
}), y = q(
|
|
601
|
-
|
|
600
|
+
_,
|
|
602
601
|
S,
|
|
603
602
|
L
|
|
604
603
|
);
|
|
605
|
-
if ((
|
|
604
|
+
if ((m = t.preserveEmbeddedExteriorWhitespaces) != null && m.includes(s))
|
|
606
605
|
return G([
|
|
607
606
|
"`",
|
|
608
|
-
|
|
609
|
-
(
|
|
607
|
+
f,
|
|
608
|
+
(c = t.noEmbeddedMultiLineIndentation) != null && c.includes(s) ? [G(y)] : Se([G(y)]),
|
|
610
609
|
b,
|
|
611
610
|
"`"
|
|
612
611
|
]);
|
|
613
|
-
const
|
|
612
|
+
const h = f.length ? Le : Te, a = b.length ? Le : Te;
|
|
614
613
|
return G([
|
|
615
614
|
"`",
|
|
616
|
-
(
|
|
615
|
+
(u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [h, G(y)] : Se([h, G(y)]),
|
|
617
616
|
a,
|
|
618
617
|
"`"
|
|
619
618
|
]);
|
|
620
|
-
} catch (
|
|
621
|
-
throw console.error(
|
|
619
|
+
} catch (p) {
|
|
620
|
+
throw console.error(p), p;
|
|
622
621
|
}
|
|
623
|
-
},
|
|
624
|
-
[
|
|
622
|
+
}, Jt = ["php", "php5", "phtml", "ctp"], Kt = R(Ve), Zt = {
|
|
623
|
+
[Kt]: {
|
|
625
624
|
category: "Global",
|
|
626
625
|
type: "string",
|
|
627
626
|
array: !0,
|
|
628
|
-
default: [{ value: [...
|
|
627
|
+
default: [{ value: [...Jt] }],
|
|
629
628
|
description: 'Specify embedded PHP language identifiers. This requires "@prettier/plugin-php".'
|
|
630
629
|
}
|
|
631
|
-
},
|
|
630
|
+
}, en = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
632
631
|
__proto__: null,
|
|
633
632
|
embeddedLanguage: Ve,
|
|
634
|
-
embedder:
|
|
635
|
-
options:
|
|
633
|
+
embedder: Qt,
|
|
634
|
+
options: Zt
|
|
636
635
|
}, Symbol.toStringTag, { value: "Module" })), Ye = "embeddedRuby", K = [
|
|
637
636
|
"ruby",
|
|
638
637
|
"arb",
|
|
@@ -659,53 +658,53 @@ const { line: pe, group: B, indent: he, softline: ge } = k, Et = async (e, n, r,
|
|
|
659
658
|
"ru",
|
|
660
659
|
"thor",
|
|
661
660
|
"watchr"
|
|
662
|
-
], Z = ["rbs"], ee = ["haml"],
|
|
661
|
+
], Z = ["rbs"], ee = ["haml"], tn = [
|
|
663
662
|
...K,
|
|
664
663
|
...Z,
|
|
665
664
|
...ee
|
|
666
|
-
],
|
|
667
|
-
[
|
|
665
|
+
], nn = "embeddedRubyParser", sn = R(Ye), rn = {
|
|
666
|
+
[sn]: {
|
|
668
667
|
category: "Global",
|
|
669
668
|
type: "string",
|
|
670
669
|
array: !0,
|
|
671
|
-
default: [{ value: [...
|
|
670
|
+
default: [{ value: [...tn] }],
|
|
672
671
|
description: 'Specify embedded Ruby language identifiers. This requires "@prettier/plugin-ruby".'
|
|
673
672
|
},
|
|
674
|
-
[
|
|
673
|
+
[nn]: {
|
|
675
674
|
category: "Global",
|
|
676
675
|
type: "string",
|
|
677
676
|
array: !1,
|
|
678
677
|
default: void 0,
|
|
679
678
|
description: "Specify the embedded Ruby language parser."
|
|
680
679
|
}
|
|
681
|
-
}, { line: Oe, group: z, indent: Ue, softline: Pe } = k,
|
|
682
|
-
var
|
|
680
|
+
}, { line: Oe, group: z, indent: Ue, softline: Pe } = k, on = async (e, n, r, t, s, o) => {
|
|
681
|
+
var g, m, c, u, p;
|
|
683
682
|
try {
|
|
684
683
|
Q("@prettier/plugin-ruby", t, s);
|
|
685
|
-
const { node: $ } = r, { createPlaceholder: S, placeholderRegex: i } = j(),
|
|
684
|
+
const { node: $ } = r, { createPlaceholder: S, placeholderRegex: i } = j(), f = $.quasis.map(
|
|
686
685
|
(E, D, { length: O }) => D === O - 1 ? E.value.cooked : E.value.cooked + S(D)
|
|
687
|
-
).join(""), b = ((
|
|
686
|
+
).join(""), b = ((g = f.match(/^\s+/)) == null ? void 0 : g[0]) ?? "", v = ((m = f.match(/\s+$/)) == null ? void 0 : m[0]) ?? "", L = f.slice(
|
|
688
687
|
b.length,
|
|
689
688
|
-v.length || void 0
|
|
690
|
-
),
|
|
689
|
+
), _ = M(r, n), y = an(t, s, o), h = await e(L, {
|
|
691
690
|
parser: y
|
|
692
691
|
}), a = q(
|
|
693
|
-
|
|
692
|
+
h,
|
|
694
693
|
i,
|
|
695
|
-
|
|
694
|
+
_
|
|
696
695
|
);
|
|
697
|
-
if ((
|
|
696
|
+
if ((c = t.preserveEmbeddedExteriorWhitespaces) != null && c.includes(s))
|
|
698
697
|
return z([
|
|
699
698
|
"`",
|
|
700
699
|
b,
|
|
701
|
-
(
|
|
700
|
+
(u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [z(a)] : Ue([z(a)]),
|
|
702
701
|
v,
|
|
703
702
|
"`"
|
|
704
703
|
]);
|
|
705
|
-
const
|
|
704
|
+
const l = b.length ? Oe : Pe, I = v.length ? Oe : Pe;
|
|
706
705
|
return z([
|
|
707
706
|
"`",
|
|
708
|
-
(
|
|
707
|
+
(p = t.noEmbeddedMultiLineIndentation) != null && p.includes(s) ? [l, z(a)] : Ue([l, z(a)]),
|
|
709
708
|
I,
|
|
710
709
|
"`"
|
|
711
710
|
]);
|
|
@@ -713,37 +712,37 @@ const { line: pe, group: B, indent: he, softline: ge } = k, Et = async (e, n, r,
|
|
|
713
712
|
throw console.error($), $;
|
|
714
713
|
}
|
|
715
714
|
};
|
|
716
|
-
function
|
|
715
|
+
function an(e, n, r) {
|
|
717
716
|
if (typeof e.embeddedRubyParser == "string")
|
|
718
717
|
return e.embeddedRubyParser;
|
|
719
718
|
const t = r.indexOf(n);
|
|
720
719
|
for (let s = t; s >= 0; --s) {
|
|
721
|
-
if (
|
|
720
|
+
if (dn(n))
|
|
722
721
|
return K[0];
|
|
723
|
-
if (
|
|
722
|
+
if (ln(n))
|
|
724
723
|
return Z[0];
|
|
725
|
-
if (
|
|
724
|
+
if (cn(n))
|
|
726
725
|
return ee[0];
|
|
727
726
|
}
|
|
728
727
|
throw new SyntaxError(`Unrecognized ruby identifier: ${n}`);
|
|
729
728
|
}
|
|
730
|
-
function
|
|
729
|
+
function dn(e) {
|
|
731
730
|
return K.includes(e);
|
|
732
731
|
}
|
|
733
|
-
function
|
|
732
|
+
function ln(e) {
|
|
734
733
|
return Z.includes(e);
|
|
735
734
|
}
|
|
736
|
-
function
|
|
735
|
+
function cn(e) {
|
|
737
736
|
return ee.includes(e);
|
|
738
737
|
}
|
|
739
|
-
const
|
|
738
|
+
const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
740
739
|
__proto__: null,
|
|
741
740
|
HAML_PARSER_IDENTIFIERS: ee,
|
|
742
741
|
RBS_PARSER_IDENTIFIERS: Z,
|
|
743
742
|
RUBY_PARSER_IDENTIFIERS: K,
|
|
744
743
|
embeddedLanguage: Ye,
|
|
745
|
-
embedder:
|
|
746
|
-
options:
|
|
744
|
+
embedder: on,
|
|
745
|
+
options: rn
|
|
747
746
|
}, Symbol.toStringTag, { value: "Module" })), Qe = "embeddedSql", ae = [
|
|
748
747
|
"sql",
|
|
749
748
|
"bigquery",
|
|
@@ -770,75 +769,75 @@ const pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
770
769
|
"postgresql",
|
|
771
770
|
"transactsql",
|
|
772
771
|
"flinksql"
|
|
773
|
-
],
|
|
774
|
-
[
|
|
772
|
+
], pn = R(Qe), hn = {
|
|
773
|
+
[pn]: {
|
|
775
774
|
category: "Global",
|
|
776
775
|
type: "string",
|
|
777
776
|
array: !0,
|
|
778
777
|
default: [{ value: [...ae] }],
|
|
779
778
|
description: 'Specify embedded SQL language identifiers. This requires "prettier-plugin-sql".'
|
|
780
779
|
}
|
|
781
|
-
}, { hardline:
|
|
782
|
-
var
|
|
780
|
+
}, { hardline: gn, group: X, line: ke, softline: Re, indent: Me } = k, { mapDoc: mn } = re, _n = async (e, n, r, t, s, o) => {
|
|
781
|
+
var g, m, c, u, p;
|
|
783
782
|
try {
|
|
784
783
|
Q("prettier-plugin-sql", t, s);
|
|
785
|
-
const { node: $ } = r, { createPlaceholder: S, placeholderRegex: i } = j(),
|
|
784
|
+
const { node: $ } = r, { createPlaceholder: S, placeholderRegex: i } = j(), f = $.quasis.map(
|
|
786
785
|
(I, E, { length: D }) => E === D - 1 ? I.value.cooked : I.value.cooked + S(E)
|
|
787
|
-
).join(""), b = ((
|
|
786
|
+
).join(""), b = ((g = f.match(/^\s+/)) == null ? void 0 : g[0]) ?? "", v = ((m = f.match(/\s+$/)) == null ? void 0 : m[0]) ?? "", L = M(r, n), _ = bn(
|
|
788
787
|
t,
|
|
789
788
|
s,
|
|
790
789
|
o
|
|
791
790
|
);
|
|
792
|
-
if (typeof
|
|
791
|
+
if (typeof _ > "u")
|
|
793
792
|
throw new SyntaxError(`Unrecognized identifier: ${s}`);
|
|
794
|
-
const y = await e(
|
|
793
|
+
const y = await e(f, {
|
|
795
794
|
parser: "sql",
|
|
796
|
-
...
|
|
797
|
-
}),
|
|
795
|
+
..._
|
|
796
|
+
}), h = mn(y, (I) => {
|
|
798
797
|
if (typeof I != "string")
|
|
799
798
|
return I;
|
|
800
799
|
const E = [], D = I.split(i);
|
|
801
800
|
for (let O = 0; O < D.length; O++) {
|
|
802
|
-
let
|
|
801
|
+
let d = D[O];
|
|
803
802
|
if (O % 2 == 0) {
|
|
804
|
-
if (!
|
|
803
|
+
if (!d)
|
|
805
804
|
continue;
|
|
806
|
-
|
|
805
|
+
d = d.replaceAll(/([\\`]|\${)/g, "\\$1"), d.split(/(\n)/).forEach(
|
|
807
806
|
(x) => x === `
|
|
808
|
-
` ? E.push(
|
|
807
|
+
` ? E.push(gn) : E.push(x)
|
|
809
808
|
);
|
|
810
809
|
} else {
|
|
811
|
-
const x = Number(
|
|
810
|
+
const x = Number(d);
|
|
812
811
|
E.push(L[x]);
|
|
813
812
|
}
|
|
814
813
|
}
|
|
815
814
|
return E;
|
|
816
815
|
});
|
|
817
|
-
if ((
|
|
816
|
+
if ((c = t.preserveEmbeddedExteriorWhitespaces) != null && c.includes(s))
|
|
818
817
|
return X([
|
|
819
818
|
"`",
|
|
820
819
|
b,
|
|
821
|
-
(
|
|
820
|
+
(u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [X(h)] : Me([X(h)]),
|
|
822
821
|
v,
|
|
823
822
|
"`"
|
|
824
823
|
]);
|
|
825
|
-
const a = b.length ? ke : Re,
|
|
824
|
+
const a = b.length ? ke : Re, l = v.length ? ke : Re;
|
|
826
825
|
return X([
|
|
827
826
|
"`",
|
|
828
|
-
(
|
|
829
|
-
|
|
827
|
+
(p = t.noEmbeddedMultiLineIndentation) != null && p.includes(s) ? [a, X(h)] : Me([a, X(h)]),
|
|
828
|
+
l,
|
|
830
829
|
"`"
|
|
831
830
|
]);
|
|
832
831
|
} catch ($) {
|
|
833
832
|
throw console.error($), $;
|
|
834
833
|
}
|
|
835
|
-
},
|
|
834
|
+
}, fn = {
|
|
836
835
|
"sql-formatter": (e) => ae.includes(e),
|
|
837
836
|
"node-sql-parser": (e) => Je.includes(e)
|
|
838
837
|
};
|
|
839
838
|
function je(e, n) {
|
|
840
839
|
for (const r of n)
|
|
841
|
-
if (
|
|
840
|
+
if (fn[r](e))
|
|
842
841
|
switch (r) {
|
|
843
842
|
case "sql-formatter":
|
|
844
843
|
return {
|
|
@@ -864,7 +863,7 @@ function ne(e, n, r) {
|
|
|
864
863
|
), t)
|
|
865
864
|
return t;
|
|
866
865
|
}
|
|
867
|
-
function
|
|
866
|
+
function bn(e, n, r) {
|
|
868
867
|
switch (e.formatter ?? "sql-formatter") {
|
|
869
868
|
case "sql-formatter":
|
|
870
869
|
return ne(
|
|
@@ -886,68 +885,68 @@ function yn(e, n, r) {
|
|
|
886
885
|
);
|
|
887
886
|
}
|
|
888
887
|
}
|
|
889
|
-
const
|
|
888
|
+
const yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
890
889
|
__proto__: null,
|
|
891
890
|
NODE_SQL_PARSER_DATABASES: Je,
|
|
892
891
|
SQL_FORMATTER_LANGUAGES: ae,
|
|
893
892
|
embeddedLanguage: Qe,
|
|
894
|
-
embedder:
|
|
895
|
-
options:
|
|
896
|
-
}, Symbol.toStringTag, { value: "Module" })), Ke = "embeddedTs", { line: Ne, group: H, indent: qe, softline: Be } = k,
|
|
897
|
-
var o,
|
|
893
|
+
embedder: _n,
|
|
894
|
+
options: hn
|
|
895
|
+
}, Symbol.toStringTag, { value: "Module" })), Ke = "embeddedTs", { line: Ne, group: H, indent: qe, softline: Be } = k, In = async (e, n, r, t, s) => {
|
|
896
|
+
var o, g, m, c, u;
|
|
898
897
|
try {
|
|
899
|
-
const { node:
|
|
900
|
-
(a,
|
|
901
|
-
).join(""),
|
|
898
|
+
const { node: p } = r, { createPlaceholder: $, placeholderRegex: S } = j(), i = p.quasis.map(
|
|
899
|
+
(a, l, { length: I }) => l === I - 1 ? a.value.cooked : a.value.cooked + $(l)
|
|
900
|
+
).join(""), f = ((o = i.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", b = ((g = i.match(/\s+$/)) == null ? void 0 : g[0]) ?? "", v = M(r, n), L = await e(i, {
|
|
902
901
|
parser: t.embeddedTsParser ?? "typescript",
|
|
903
902
|
// set filepath to undefined to enable jsx auto detection:
|
|
904
903
|
// https://github.com/prettier/prettier/blob/427a84d24203e2d54160cde153a1e6a6390fe65a/src/language-js/parse/typescript.js#L49-L53
|
|
905
904
|
filepath: void 0
|
|
906
|
-
}),
|
|
905
|
+
}), _ = q(
|
|
907
906
|
L,
|
|
908
907
|
S,
|
|
909
908
|
v
|
|
910
909
|
);
|
|
911
|
-
if ((
|
|
910
|
+
if ((m = t.preserveEmbeddedExteriorWhitespaces) != null && m.includes(s))
|
|
912
911
|
return H([
|
|
913
912
|
"`",
|
|
914
|
-
|
|
915
|
-
(
|
|
913
|
+
f,
|
|
914
|
+
(c = t.noEmbeddedMultiLineIndentation) != null && c.includes(s) ? [H(_)] : qe([H(_)]),
|
|
916
915
|
b,
|
|
917
916
|
"`"
|
|
918
917
|
]);
|
|
919
|
-
const y =
|
|
918
|
+
const y = f.length ? Ne : Be, h = b.length ? Ne : Be;
|
|
920
919
|
return H([
|
|
921
920
|
"`",
|
|
922
|
-
(
|
|
923
|
-
|
|
921
|
+
(u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [y, H(_)] : qe([y, H(_)]),
|
|
922
|
+
h,
|
|
924
923
|
"`"
|
|
925
924
|
]);
|
|
926
|
-
} catch (
|
|
927
|
-
throw console.error(
|
|
925
|
+
} catch (p) {
|
|
926
|
+
throw console.error(p), p;
|
|
928
927
|
}
|
|
929
|
-
},
|
|
930
|
-
[
|
|
928
|
+
}, En = ["ts", "tsx", "cts", "mts", "typescript"], xn = "embeddedTsParser", $n = R(Ke), vn = {
|
|
929
|
+
[$n]: {
|
|
931
930
|
category: "Global",
|
|
932
931
|
type: "string",
|
|
933
932
|
array: !0,
|
|
934
|
-
default: [{ value: [...
|
|
933
|
+
default: [{ value: [...En] }],
|
|
935
934
|
description: "Specify embedded TS language parsers."
|
|
936
935
|
},
|
|
937
|
-
[
|
|
936
|
+
[xn]: {
|
|
938
937
|
category: "Global",
|
|
939
938
|
type: "string",
|
|
940
939
|
array: !1,
|
|
941
940
|
default: "typescript",
|
|
942
941
|
description: "Specify the embedded TS language parser."
|
|
943
942
|
}
|
|
944
|
-
},
|
|
943
|
+
}, wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
945
944
|
__proto__: null,
|
|
946
945
|
embeddedLanguage: Ke,
|
|
947
|
-
embedder:
|
|
948
|
-
options:
|
|
946
|
+
embedder: In,
|
|
947
|
+
options: vn
|
|
949
948
|
}, Symbol.toStringTag, { value: "Module" })), de = "embeddedXml";
|
|
950
|
-
function
|
|
949
|
+
function Dn(e) {
|
|
951
950
|
const n = {
|
|
952
951
|
loc: {
|
|
953
952
|
start: {
|
|
@@ -987,53 +986,53 @@ function Fe(e) {
|
|
|
987
986
|
);
|
|
988
987
|
return Object.assign(r, n), r;
|
|
989
988
|
}
|
|
990
|
-
const
|
|
991
|
-
parse(e, n) {
|
|
992
|
-
var
|
|
993
|
-
const {
|
|
994
|
-
if (r.length > 0) {
|
|
995
|
-
const g = r[0];
|
|
996
|
-
throw Ln(g);
|
|
997
|
-
}
|
|
989
|
+
const Ln = {
|
|
990
|
+
async parse(e, n) {
|
|
991
|
+
var g, m;
|
|
992
|
+
const { parse: r } = await import("@xml-tools/parser"), { lexErrors: t, parseErrors: s, cst: o } = r(e);
|
|
998
993
|
if (t.length > 0) {
|
|
999
|
-
|
|
1000
|
-
|
|
994
|
+
const c = t[0];
|
|
995
|
+
throw Dn(c);
|
|
996
|
+
}
|
|
997
|
+
if (s.length > 0) {
|
|
998
|
+
let c = !1;
|
|
999
|
+
for (const u of s) {
|
|
1001
1000
|
if (!["MismatchedTokenException", "NotAllInputParsedException"].includes(
|
|
1002
|
-
|
|
1001
|
+
u.name
|
|
1003
1002
|
))
|
|
1004
|
-
throw Fe(
|
|
1005
|
-
if (
|
|
1006
|
-
|
|
1003
|
+
throw Fe(u);
|
|
1004
|
+
if (u.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
|
|
1005
|
+
c = !0;
|
|
1007
1006
|
continue;
|
|
1008
1007
|
}
|
|
1009
1008
|
if (/Expecting token of type --> EOF <-- but found --> '.+' <--/.test(
|
|
1010
|
-
|
|
1011
|
-
) || /Redundant input, expecting EOF but found: /.test(
|
|
1012
|
-
(
|
|
1009
|
+
u.message
|
|
1010
|
+
) || /Redundant input, expecting EOF but found: /.test(u.message)) {
|
|
1011
|
+
(g = n.__embeddedXmlFragmentRecoverIndex) == null || g.splice(
|
|
1013
1012
|
0,
|
|
1014
1013
|
n.__embeddedXmlFragmentRecoverIndex.length,
|
|
1015
|
-
|
|
1014
|
+
u.token.startOffset
|
|
1016
1015
|
);
|
|
1017
1016
|
break;
|
|
1018
1017
|
}
|
|
1019
1018
|
if (/Expecting token of type --> OPEN <-- but found --> '.+' <--/.test(
|
|
1020
|
-
|
|
1019
|
+
u.message
|
|
1021
1020
|
)) {
|
|
1022
|
-
if (
|
|
1021
|
+
if (u.token.endOffset === void 0 || Number.isNaN(u.token.endOffset))
|
|
1023
1022
|
break;
|
|
1024
|
-
(
|
|
1023
|
+
(m = n.__embeddedXmlFragmentRecoverIndex) == null || m.splice(
|
|
1025
1024
|
0,
|
|
1026
1025
|
n.__embeddedXmlFragmentRecoverIndex.length,
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
),
|
|
1026
|
+
u.token.startOffset,
|
|
1027
|
+
u.token.endOffset
|
|
1028
|
+
), c = !0;
|
|
1030
1029
|
break;
|
|
1031
1030
|
}
|
|
1032
|
-
throw Fe(
|
|
1031
|
+
throw Fe(u);
|
|
1033
1032
|
}
|
|
1034
|
-
|
|
1033
|
+
c && Ze(o);
|
|
1035
1034
|
}
|
|
1036
|
-
return
|
|
1035
|
+
return o;
|
|
1037
1036
|
},
|
|
1038
1037
|
astFormat: "xml",
|
|
1039
1038
|
locStart(e) {
|
|
@@ -1049,7 +1048,7 @@ function Ze(e) {
|
|
|
1049
1048
|
const t = n[r] ?? [];
|
|
1050
1049
|
for (let s = t.length - 1; s >= 0; --s) {
|
|
1051
1050
|
const o = t[s];
|
|
1052
|
-
if (
|
|
1051
|
+
if (Sn(o)) {
|
|
1053
1052
|
if (Object.keys(o.children).length === 0) {
|
|
1054
1053
|
t.splice(s, 1), t.length === 0 && delete n[r];
|
|
1055
1054
|
continue;
|
|
@@ -1059,58 +1058,58 @@ function Ze(e) {
|
|
|
1059
1058
|
}
|
|
1060
1059
|
}
|
|
1061
1060
|
}
|
|
1062
|
-
function
|
|
1061
|
+
function Sn(e) {
|
|
1063
1062
|
return "name" in e && "children" in e && "location" in e;
|
|
1064
1063
|
}
|
|
1065
|
-
const { line: Ae, group: V, indent: Ce, softline: se } = k,
|
|
1066
|
-
var o,
|
|
1064
|
+
const { line: Ae, group: V, indent: Ce, softline: se } = k, Tn = async (e, n, r, t, s) => {
|
|
1065
|
+
var o, g, m, c, u, p;
|
|
1067
1066
|
try {
|
|
1068
1067
|
Q("@prettier/plugin-xml", t, s);
|
|
1069
|
-
const { node: $ } = r, { createPlaceholder: S, placeholderRegex: i } = j(),
|
|
1068
|
+
const { node: $ } = r, { createPlaceholder: S, placeholderRegex: i } = j(), f = $.quasis.map(
|
|
1070
1069
|
(E, D, { length: O }) => D === O - 1 ? E.value.cooked : E.value.cooked + S(D)
|
|
1071
|
-
).join(""), b = ((o =
|
|
1070
|
+
).join(""), b = ((o = f.match(/^\s+/)) == null ? void 0 : o[0]) ?? "", v = ((g = f.match(/\s+$/)) == null ? void 0 : g[0]) ?? "", L = f.slice(
|
|
1072
1071
|
b.length,
|
|
1073
1072
|
-v.length || void 0
|
|
1074
|
-
),
|
|
1075
|
-
let
|
|
1076
|
-
for (;
|
|
1077
|
-
const E = L.slice(
|
|
1073
|
+
), _ = M(r, n), y = [];
|
|
1074
|
+
let h = 0;
|
|
1075
|
+
for (; h !== void 0; ) {
|
|
1076
|
+
const E = L.slice(h);
|
|
1078
1077
|
if (E.length === 0)
|
|
1079
1078
|
break;
|
|
1080
|
-
|
|
1079
|
+
h > 0 && t.xmlWhitespaceSensitivity !== "strict" && y.push(se), (m = t.__embeddedXmlFragmentRecoverIndex) == null || m.splice(
|
|
1081
1080
|
0,
|
|
1082
1081
|
t.__embeddedXmlFragmentRecoverIndex.length
|
|
1083
1082
|
);
|
|
1084
1083
|
let D = await e(E, {
|
|
1085
1084
|
parser: de
|
|
1086
1085
|
});
|
|
1087
|
-
const [O,
|
|
1088
|
-
O === void 0 ?
|
|
1086
|
+
const [O, d] = t.__embeddedXmlFragmentRecoverIndex ?? [];
|
|
1087
|
+
O === void 0 ? h = void 0 : d === void 0 ? h += O : (D = E.slice(O, d + 1), h += d + 1), y.push(D);
|
|
1089
1088
|
}
|
|
1090
1089
|
const a = q(
|
|
1091
1090
|
y,
|
|
1092
1091
|
i,
|
|
1093
|
-
|
|
1092
|
+
_
|
|
1094
1093
|
);
|
|
1095
|
-
if (t.xmlWhitespaceSensitivity === "strict" || (
|
|
1094
|
+
if (t.xmlWhitespaceSensitivity === "strict" || (c = t.preserveEmbeddedExteriorWhitespaces) != null && c.includes(s))
|
|
1096
1095
|
return V([
|
|
1097
1096
|
"`",
|
|
1098
1097
|
b,
|
|
1099
|
-
(
|
|
1098
|
+
(u = t.noEmbeddedMultiLineIndentation) != null && u.includes(s) ? [V(a)] : Ce([V(a)]),
|
|
1100
1099
|
v,
|
|
1101
1100
|
"`"
|
|
1102
1101
|
]);
|
|
1103
|
-
const
|
|
1102
|
+
const l = b.length ? Ae : se, I = v.length ? Ae : se;
|
|
1104
1103
|
return V([
|
|
1105
1104
|
"`",
|
|
1106
|
-
(
|
|
1105
|
+
(p = t.noEmbeddedMultiLineIndentation) != null && p.includes(s) ? [l, V(a)] : Ce([l, V(a)]),
|
|
1107
1106
|
I,
|
|
1108
1107
|
"`"
|
|
1109
1108
|
]);
|
|
1110
1109
|
} catch ($) {
|
|
1111
1110
|
throw console.error($), $;
|
|
1112
1111
|
}
|
|
1113
|
-
},
|
|
1112
|
+
}, On = [
|
|
1114
1113
|
"xml",
|
|
1115
1114
|
"xsd",
|
|
1116
1115
|
"ascx",
|
|
@@ -1167,12 +1166,12 @@ const { line: Ae, group: V, indent: Ce, softline: se } = k, On = async (e, n, r,
|
|
|
1167
1166
|
"xpdl",
|
|
1168
1167
|
"xul",
|
|
1169
1168
|
"xoml"
|
|
1170
|
-
],
|
|
1171
|
-
[
|
|
1169
|
+
], Un = R(de), Pn = {
|
|
1170
|
+
[Un]: {
|
|
1172
1171
|
category: "Global",
|
|
1173
1172
|
type: "string",
|
|
1174
1173
|
array: !0,
|
|
1175
|
-
default: [{ value: [...
|
|
1174
|
+
default: [{ value: [...On] }],
|
|
1176
1175
|
description: 'Specify embedded XML language identifiers. This requires "@prettier/plugin-xml".'
|
|
1177
1176
|
},
|
|
1178
1177
|
/** @internal */
|
|
@@ -1183,31 +1182,31 @@ const { line: Ae, group: V, indent: Ce, softline: se } = k, On = async (e, n, r,
|
|
|
1183
1182
|
default: [{ value: [] }],
|
|
1184
1183
|
description: "This option is read only and used as a workaround to support xml fragments"
|
|
1185
1184
|
}
|
|
1186
|
-
},
|
|
1185
|
+
}, kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1187
1186
|
__proto__: null,
|
|
1188
1187
|
embeddedLanguage: de,
|
|
1189
|
-
embedder:
|
|
1190
|
-
options:
|
|
1191
|
-
parser:
|
|
1192
|
-
}, Symbol.toStringTag, { value: "Module" })), et = [], tt = {}, nt = {}, st = {},
|
|
1193
|
-
"./css/index.ts":
|
|
1194
|
-
"./es/index.ts":
|
|
1195
|
-
"./glsl/index.ts":
|
|
1196
|
-
"./html/index.ts":
|
|
1197
|
-
"./markdown/index.ts":
|
|
1198
|
-
"./noop/index.ts":
|
|
1199
|
-
"./php/index.ts":
|
|
1200
|
-
"./ruby/index.ts":
|
|
1201
|
-
"./sql/index.ts":
|
|
1202
|
-
"./ts/index.ts":
|
|
1203
|
-
"./xml/index.ts":
|
|
1188
|
+
embedder: Tn,
|
|
1189
|
+
options: Pn,
|
|
1190
|
+
parser: Ln
|
|
1191
|
+
}, Symbol.toStringTag, { value: "Module" })), et = [], tt = {}, nt = {}, st = {}, Rn = /* @__PURE__ */ Object.assign({
|
|
1192
|
+
"./css/index.ts": vt,
|
|
1193
|
+
"./es/index.ts": Ot,
|
|
1194
|
+
"./glsl/index.ts": Mt,
|
|
1195
|
+
"./html/index.ts": At,
|
|
1196
|
+
"./markdown/index.ts": Xt,
|
|
1197
|
+
"./noop/index.ts": Yt,
|
|
1198
|
+
"./php/index.ts": en,
|
|
1199
|
+
"./ruby/index.ts": un,
|
|
1200
|
+
"./sql/index.ts": yn,
|
|
1201
|
+
"./ts/index.ts": wn,
|
|
1202
|
+
"./xml/index.ts": kn
|
|
1204
1203
|
});
|
|
1205
|
-
Object.values(
|
|
1204
|
+
Object.values(Rn).forEach(
|
|
1206
1205
|
({ embeddedLanguage: e, parser: n, embedder: r, options: t }) => {
|
|
1207
|
-
|
|
1206
|
+
bt(et, e, oe), n && (tt[e] = n), r && (nt[e] = r), Object.assign(st, t);
|
|
1208
1207
|
}
|
|
1209
1208
|
);
|
|
1210
|
-
const
|
|
1209
|
+
const Qn = {
|
|
1211
1210
|
// parsers from internal
|
|
1212
1211
|
...rt.parsers,
|
|
1213
1212
|
...it.parsers,
|
|
@@ -1216,7 +1215,7 @@ const Kn = {
|
|
|
1216
1215
|
...dt.parsers,
|
|
1217
1216
|
// parsers from this plugin
|
|
1218
1217
|
...tt
|
|
1219
|
-
}, { estree: J } =
|
|
1218
|
+
}, { estree: J } = lt, Mn = function(e, n) {
|
|
1220
1219
|
var t;
|
|
1221
1220
|
const { node: r } = e;
|
|
1222
1221
|
if (r.type !== "TemplateLiteral" || r.quasis.some(({ value: { cooked: s } }) => s === null))
|
|
@@ -1225,32 +1224,32 @@ const Kn = {
|
|
|
1225
1224
|
const o = n[R(s)];
|
|
1226
1225
|
if (!o)
|
|
1227
1226
|
continue;
|
|
1228
|
-
const
|
|
1227
|
+
const g = jn(
|
|
1229
1228
|
e,
|
|
1230
1229
|
o,
|
|
1231
1230
|
n.noEmbeddedIdentificationByComment ?? []
|
|
1232
|
-
) ??
|
|
1231
|
+
) ?? Nn(
|
|
1233
1232
|
e,
|
|
1234
1233
|
o,
|
|
1235
1234
|
n.noEmbeddedIdentificationByTag ?? []
|
|
1236
1235
|
);
|
|
1237
|
-
if (
|
|
1236
|
+
if (g === void 0)
|
|
1238
1237
|
continue;
|
|
1239
|
-
const
|
|
1240
|
-
if (!
|
|
1238
|
+
const m = nt[s];
|
|
1239
|
+
if (!m)
|
|
1241
1240
|
return null;
|
|
1242
|
-
const
|
|
1243
|
-
return
|
|
1244
|
-
const
|
|
1241
|
+
const c = e.node;
|
|
1242
|
+
return c.quasis.length === 1 && c.quasis[0].value.raw.trim() === "" ? "``" : async (...u) => {
|
|
1243
|
+
const p = await m(...u, g, o);
|
|
1245
1244
|
return k.label(
|
|
1246
|
-
{ embed: !0, ...
|
|
1247
|
-
|
|
1245
|
+
{ embed: !0, ...p.label },
|
|
1246
|
+
p
|
|
1248
1247
|
);
|
|
1249
1248
|
};
|
|
1250
1249
|
}
|
|
1251
1250
|
return ((t = J.embed) == null ? void 0 : t.call(J, e, n)) ?? null;
|
|
1252
1251
|
};
|
|
1253
|
-
function
|
|
1252
|
+
function jn({ node: e, parent: n }, r, t) {
|
|
1254
1253
|
if (r.length === 0 || e.type !== "TemplateLiteral")
|
|
1255
1254
|
return;
|
|
1256
1255
|
const s = e.comments ?? (n == null ? void 0 : n.comments);
|
|
@@ -1265,47 +1264,47 @@ function Nn({ node: e, parent: n }, r, t) {
|
|
|
1265
1264
|
"CommentBlock"
|
|
1266
1265
|
// babel, babel-flow, babel-ts
|
|
1267
1266
|
].includes(o.type) || !o.leading)) {
|
|
1268
|
-
for (const
|
|
1269
|
-
if (` ${
|
|
1270
|
-
return
|
|
1267
|
+
for (const g of r)
|
|
1268
|
+
if (` ${g} ` === o.value && !t.includes(g))
|
|
1269
|
+
return g;
|
|
1271
1270
|
}
|
|
1272
1271
|
}
|
|
1273
|
-
function
|
|
1272
|
+
function Nn({ node: e, parent: n }, r, t) {
|
|
1274
1273
|
if (r.length !== 0 && !(e.type !== "TemplateLiteral" || (n == null ? void 0 : n.type) !== "TaggedTemplateExpression" || n.tag.type !== "Identifier")) {
|
|
1275
1274
|
for (const s of r)
|
|
1276
1275
|
if (n.tag.name === s && !t.includes(s))
|
|
1277
1276
|
return s;
|
|
1278
1277
|
}
|
|
1279
1278
|
}
|
|
1280
|
-
const
|
|
1279
|
+
const Jn = {
|
|
1281
1280
|
estree: {
|
|
1282
1281
|
...J,
|
|
1283
|
-
embed:
|
|
1282
|
+
embed: Mn
|
|
1284
1283
|
}
|
|
1285
|
-
},
|
|
1284
|
+
}, qn = "noEmbeddedIdentificationByComment", Bn = "noEmbeddedIdentificationByTag", Fn = "preserveEmbeddedExteriorWhitespaces", An = "noEmbeddedMultiLineIndentation", Kn = {
|
|
1286
1285
|
...st,
|
|
1287
|
-
[
|
|
1286
|
+
[qn]: {
|
|
1288
1287
|
category: "Global",
|
|
1289
1288
|
type: "string",
|
|
1290
1289
|
array: !0,
|
|
1291
1290
|
default: [{ value: [] }],
|
|
1292
1291
|
description: 'This option turns off "/* identifier */ `...`" comment-based language identification for the specified identifiers.'
|
|
1293
1292
|
},
|
|
1294
|
-
[
|
|
1293
|
+
[Bn]: {
|
|
1295
1294
|
category: "Global",
|
|
1296
1295
|
type: "string",
|
|
1297
1296
|
array: !0,
|
|
1298
1297
|
default: [{ value: [] }],
|
|
1299
1298
|
description: 'This option turns off "identifier`...`" tag-based language identification for the specified identifiers.'
|
|
1300
1299
|
},
|
|
1301
|
-
[
|
|
1300
|
+
[Fn]: {
|
|
1302
1301
|
category: "Config",
|
|
1303
1302
|
type: "string",
|
|
1304
1303
|
array: !0,
|
|
1305
1304
|
default: [{ value: [] }],
|
|
1306
1305
|
description: "This option preserves leading and trailing whitespaces in the formatting results for the specified identifiers."
|
|
1307
1306
|
},
|
|
1308
|
-
[
|
|
1307
|
+
[An]: {
|
|
1309
1308
|
category: "Global",
|
|
1310
1309
|
type: "string",
|
|
1311
1310
|
array: !0,
|
|
@@ -1318,8 +1317,8 @@ export {
|
|
|
1318
1317
|
et as embeddedLanguages,
|
|
1319
1318
|
st as embeddedOptions,
|
|
1320
1319
|
tt as embeddedParsers,
|
|
1321
|
-
R as
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1320
|
+
R as makeIdentifiersOptionName,
|
|
1321
|
+
Kn as options,
|
|
1322
|
+
Qn as parsers,
|
|
1323
|
+
Jn as printers
|
|
1325
1324
|
};
|