@vue/compiler-sfc 3.5.27 → 3.5.29
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 +1 -1
- package/dist/compiler-sfc.cjs.js +119 -87
- package/dist/compiler-sfc.esm-browser.js +278 -342
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Lower level utilities for compiling Vue Single File Components
|
|
4
4
|
|
|
5
|
-
**Note: as of 3.2.13+, this package is included as a dependency of the main `vue` package and can be accessed as `vue/compiler-sfc`. This means you no longer need to explicitly install this package and ensure its version
|
|
5
|
+
**Note: as of 3.2.13+, this package is included as a dependency of the main `vue` package and can be accessed as `vue/compiler-sfc`. This means you no longer need to explicitly install this package and ensure its version matches that of `vue`'s. Just use the main `vue/compiler-sfc` deep import instead.**
|
|
6
6
|
|
|
7
7
|
This package contains lower level utilities that you can use if you are writing a plugin / transform for a bundler or module system that compiles Vue Single File Components (SFCs) into JavaScript. It is used in [vue-loader](https://github.com/vuejs/vue-loader) and [@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue).
|
|
8
8
|
|
package/dist/compiler-sfc.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-sfc v3.5.
|
|
2
|
+
* @vue/compiler-sfc v3.5.29
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -7158,7 +7158,7 @@ function requireParser$2 () {
|
|
|
7158
7158
|
if (_space2.endsWith(' ') && _rawSpace2.endsWith(' ')) {
|
|
7159
7159
|
spaces.before = _space2.slice(0, _space2.length - 1);
|
|
7160
7160
|
raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1);
|
|
7161
|
-
} else if (_space2
|
|
7161
|
+
} else if (_space2[0] === ' ' && _rawSpace2[0] === ' ') {
|
|
7162
7162
|
spaces.after = _space2.slice(1);
|
|
7163
7163
|
raws.spaces.after = _rawSpace2.slice(1);
|
|
7164
7164
|
} else {
|
|
@@ -19810,7 +19810,7 @@ function resolveParserPlugins(lang, userPlugins, dts = false) {
|
|
|
19810
19810
|
} else if (userPlugins) {
|
|
19811
19811
|
userPlugins = userPlugins.filter((p) => p !== "jsx");
|
|
19812
19812
|
}
|
|
19813
|
-
if (lang === "ts" || lang === "mts" || lang === "tsx" || lang === "mtsx") {
|
|
19813
|
+
if (lang === "ts" || lang === "mts" || lang === "tsx" || lang === "cts" || lang === "mtsx") {
|
|
19814
19814
|
plugins.push(["typescript", { dts }], "explicitResourceManagement");
|
|
19815
19815
|
if (!userPlugins || !userPlugins.includes("decorators")) {
|
|
19816
19816
|
plugins.push("decorators-legacy");
|
|
@@ -20025,6 +20025,7 @@ const openPattern = /\\{/g;
|
|
|
20025
20025
|
const closePattern = /\\}/g;
|
|
20026
20026
|
const commaPattern = /\\,/g;
|
|
20027
20027
|
const periodPattern = /\\./g;
|
|
20028
|
+
const EXPANSION_MAX = 100_000;
|
|
20028
20029
|
function numeric(str) {
|
|
20029
20030
|
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
|
|
20030
20031
|
}
|
|
@@ -20069,10 +20070,11 @@ function parseCommaParts(str) {
|
|
|
20069
20070
|
parts.push.apply(parts, p);
|
|
20070
20071
|
return parts;
|
|
20071
20072
|
}
|
|
20072
|
-
function expand(str) {
|
|
20073
|
+
function expand(str, options = {}) {
|
|
20073
20074
|
if (!str) {
|
|
20074
20075
|
return [];
|
|
20075
20076
|
}
|
|
20077
|
+
const { max = EXPANSION_MAX } = options;
|
|
20076
20078
|
// I don't know why Bash 4.3 does this, but it does.
|
|
20077
20079
|
// Anything starting with {} will have the first two bytes preserved
|
|
20078
20080
|
// but *only* at the top level, so {},a}b will not expand to anything,
|
|
@@ -20082,7 +20084,7 @@ function expand(str) {
|
|
|
20082
20084
|
if (str.slice(0, 2) === '{}') {
|
|
20083
20085
|
str = '\\{\\}' + str.slice(2);
|
|
20084
20086
|
}
|
|
20085
|
-
return expand_(escapeBraces(str), true).map(unescapeBraces);
|
|
20087
|
+
return expand_(escapeBraces(str), max, true).map(unescapeBraces);
|
|
20086
20088
|
}
|
|
20087
20089
|
function embrace(str) {
|
|
20088
20090
|
return '{' + str + '}';
|
|
@@ -20096,7 +20098,7 @@ function lte(i, y) {
|
|
|
20096
20098
|
function gte(i, y) {
|
|
20097
20099
|
return i >= y;
|
|
20098
20100
|
}
|
|
20099
|
-
function expand_(str, isTop) {
|
|
20101
|
+
function expand_(str, max, isTop) {
|
|
20100
20102
|
/** @type {string[]} */
|
|
20101
20103
|
const expansions = [];
|
|
20102
20104
|
const m = balanced('{', '}', str);
|
|
@@ -20104,9 +20106,9 @@ function expand_(str, isTop) {
|
|
|
20104
20106
|
return [str];
|
|
20105
20107
|
// no need to expand pre, since it is guaranteed to be free of brace-sets
|
|
20106
20108
|
const pre = m.pre;
|
|
20107
|
-
const post = m.post.length ? expand_(m.post, false) : [''];
|
|
20109
|
+
const post = m.post.length ? expand_(m.post, max, false) : [''];
|
|
20108
20110
|
if (/\$$/.test(m.pre)) {
|
|
20109
|
-
for (let k = 0; k < post.length; k++) {
|
|
20111
|
+
for (let k = 0; k < post.length && k < max; k++) {
|
|
20110
20112
|
const expansion = pre + '{' + m.body + '}' + post[k];
|
|
20111
20113
|
expansions.push(expansion);
|
|
20112
20114
|
}
|
|
@@ -20120,7 +20122,7 @@ function expand_(str, isTop) {
|
|
|
20120
20122
|
// {a},b}
|
|
20121
20123
|
if (m.post.match(/,(?!,).*\}/)) {
|
|
20122
20124
|
str = m.pre + '{' + m.body + escClose + m.post;
|
|
20123
|
-
return expand_(str);
|
|
20125
|
+
return expand_(str, max, true);
|
|
20124
20126
|
}
|
|
20125
20127
|
return [str];
|
|
20126
20128
|
}
|
|
@@ -20132,7 +20134,7 @@ function expand_(str, isTop) {
|
|
|
20132
20134
|
n = parseCommaParts(m.body);
|
|
20133
20135
|
if (n.length === 1 && n[0] !== undefined) {
|
|
20134
20136
|
// x{{a,b}}y ==> x{a}y x{b}y
|
|
20135
|
-
n = expand_(n[0], false).map(embrace);
|
|
20137
|
+
n = expand_(n[0], max, false).map(embrace);
|
|
20136
20138
|
//XXX is this necessary? Can't seem to hit it in tests.
|
|
20137
20139
|
/* c8 ignore start */
|
|
20138
20140
|
if (n.length === 1) {
|
|
@@ -20186,11 +20188,11 @@ function expand_(str, isTop) {
|
|
|
20186
20188
|
else {
|
|
20187
20189
|
N = [];
|
|
20188
20190
|
for (let j = 0; j < n.length; j++) {
|
|
20189
|
-
N.push.apply(N, expand_(n[j], false));
|
|
20191
|
+
N.push.apply(N, expand_(n[j], max, false));
|
|
20190
20192
|
}
|
|
20191
20193
|
}
|
|
20192
20194
|
for (let j = 0; j < N.length; j++) {
|
|
20193
|
-
for (let k = 0; k < post.length; k++) {
|
|
20195
|
+
for (let k = 0; k < post.length && expansions.length < max; k++) {
|
|
20194
20196
|
const expansion = pre + N[j] + post[k];
|
|
20195
20197
|
if (!isTop || isSequence || expansion) {
|
|
20196
20198
|
expansions.push(expansion);
|
|
@@ -20351,10 +20353,8 @@ const parseClass = (glob, position) => {
|
|
|
20351
20353
|
}
|
|
20352
20354
|
const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';
|
|
20353
20355
|
const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';
|
|
20354
|
-
const comb = ranges.length && negs.length
|
|
20355
|
-
|
|
20356
|
-
: ranges.length
|
|
20357
|
-
? sranges
|
|
20356
|
+
const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'
|
|
20357
|
+
: ranges.length ? sranges
|
|
20358
20358
|
: snegs;
|
|
20359
20359
|
return [comb, uflag, endPos - pos, true];
|
|
20360
20360
|
};
|
|
@@ -20380,14 +20380,14 @@ const parseClass = (glob, position) => {
|
|
|
20380
20380
|
*/
|
|
20381
20381
|
const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
|
|
20382
20382
|
if (magicalBraces) {
|
|
20383
|
-
return windowsPathsNoEscape
|
|
20384
|
-
|
|
20383
|
+
return windowsPathsNoEscape ?
|
|
20384
|
+
s.replace(/\[([^\/\\])\]/g, '$1')
|
|
20385
20385
|
: s
|
|
20386
20386
|
.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2')
|
|
20387
20387
|
.replace(/\\([^\/])/g, '$1');
|
|
20388
20388
|
}
|
|
20389
|
-
return windowsPathsNoEscape
|
|
20390
|
-
|
|
20389
|
+
return windowsPathsNoEscape ?
|
|
20390
|
+
s.replace(/\[([^\/\\{}])\]/g, '$1')
|
|
20391
20391
|
: s
|
|
20392
20392
|
.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, '$1$2')
|
|
20393
20393
|
.replace(/\\([^\/{}])/g, '$1');
|
|
@@ -20512,7 +20512,8 @@ class AST {
|
|
|
20512
20512
|
if (p === '')
|
|
20513
20513
|
continue;
|
|
20514
20514
|
/* c8 ignore start */
|
|
20515
|
-
if (typeof p !== 'string' &&
|
|
20515
|
+
if (typeof p !== 'string' &&
|
|
20516
|
+
!(p instanceof AST && p.#parent === this)) {
|
|
20516
20517
|
throw new Error('invalid part: ' + p);
|
|
20517
20518
|
}
|
|
20518
20519
|
/* c8 ignore stop */
|
|
@@ -20520,8 +20521,10 @@ class AST {
|
|
|
20520
20521
|
}
|
|
20521
20522
|
}
|
|
20522
20523
|
toJSON() {
|
|
20523
|
-
const ret = this.type === null
|
|
20524
|
-
|
|
20524
|
+
const ret = this.type === null ?
|
|
20525
|
+
this.#parts
|
|
20526
|
+
.slice()
|
|
20527
|
+
.map(p => (typeof p === 'string' ? p : p.toJSON()))
|
|
20525
20528
|
: [this.type, ...this.#parts.map(p => p.toJSON())];
|
|
20526
20529
|
if (this.isStart() && !this.type)
|
|
20527
20530
|
ret.unshift([]);
|
|
@@ -20810,8 +20813,8 @@ class AST {
|
|
|
20810
20813
|
!this.#parts.some(s => typeof s !== 'string');
|
|
20811
20814
|
const src = this.#parts
|
|
20812
20815
|
.map(p => {
|
|
20813
|
-
const [re, _, hasMagic, uflag] = typeof p === 'string'
|
|
20814
|
-
|
|
20816
|
+
const [re, _, hasMagic, uflag] = typeof p === 'string' ?
|
|
20817
|
+
AST.#parseGlob(p, this.#hasMagic, noEmpty)
|
|
20815
20818
|
: p.toRegExpSource(allowDot);
|
|
20816
20819
|
this.#hasMagic = this.#hasMagic || hasMagic;
|
|
20817
20820
|
this.#uflag = this.#uflag || uflag;
|
|
@@ -20840,7 +20843,10 @@ class AST {
|
|
|
20840
20843
|
// no need to prevent dots if it can't match a dot, or if a
|
|
20841
20844
|
// sub-pattern will be preventing it anyway.
|
|
20842
20845
|
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
|
|
20843
|
-
start =
|
|
20846
|
+
start =
|
|
20847
|
+
needNoTrav ? startNoTraversal
|
|
20848
|
+
: needNoDot ? startNoDot
|
|
20849
|
+
: '';
|
|
20844
20850
|
}
|
|
20845
20851
|
}
|
|
20846
20852
|
}
|
|
@@ -20876,8 +20882,8 @@ class AST {
|
|
|
20876
20882
|
return [s, unescape(this.toString()), false, false];
|
|
20877
20883
|
}
|
|
20878
20884
|
// XXX abstract out this map method
|
|
20879
|
-
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot
|
|
20880
|
-
|
|
20885
|
+
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?
|
|
20886
|
+
''
|
|
20881
20887
|
: this.#partsToRegExp(true);
|
|
20882
20888
|
if (bodyDotAllowed === body) {
|
|
20883
20889
|
bodyDotAllowed = '';
|
|
@@ -20891,20 +20897,16 @@ class AST {
|
|
|
20891
20897
|
final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
|
|
20892
20898
|
}
|
|
20893
20899
|
else {
|
|
20894
|
-
const close = this.type === '!'
|
|
20895
|
-
|
|
20896
|
-
|
|
20897
|
-
|
|
20898
|
-
|
|
20899
|
-
|
|
20900
|
-
: this.type === '@'
|
|
20901
|
-
? ')'
|
|
20902
|
-
|
|
20903
|
-
|
|
20904
|
-
: this.type === '+' && bodyDotAllowed
|
|
20905
|
-
? ')'
|
|
20906
|
-
: this.type === '*' && bodyDotAllowed
|
|
20907
|
-
? `)?`
|
|
20900
|
+
const close = this.type === '!' ?
|
|
20901
|
+
// !() must match something,but !(x) can match ''
|
|
20902
|
+
'))' +
|
|
20903
|
+
(this.isStart() && !dot && !allowDot ? startNoDot : '') +
|
|
20904
|
+
star$1 +
|
|
20905
|
+
')'
|
|
20906
|
+
: this.type === '@' ? ')'
|
|
20907
|
+
: this.type === '?' ? ')?'
|
|
20908
|
+
: this.type === '+' && bodyDotAllowed ? ')'
|
|
20909
|
+
: this.type === '*' && bodyDotAllowed ? `)?`
|
|
20908
20910
|
: `)${this.type}`;
|
|
20909
20911
|
final = start + body + close;
|
|
20910
20912
|
}
|
|
@@ -20936,6 +20938,8 @@ class AST {
|
|
|
20936
20938
|
let escaping = false;
|
|
20937
20939
|
let re = '';
|
|
20938
20940
|
let uflag = false;
|
|
20941
|
+
// multiple stars that aren't globstars coalesce into one *
|
|
20942
|
+
let inStar = false;
|
|
20939
20943
|
for (let i = 0; i < glob.length; i++) {
|
|
20940
20944
|
const c = glob.charAt(i);
|
|
20941
20945
|
if (escaping) {
|
|
@@ -20943,6 +20947,17 @@ class AST {
|
|
|
20943
20947
|
re += (reSpecials.has(c) ? '\\' : '') + c;
|
|
20944
20948
|
continue;
|
|
20945
20949
|
}
|
|
20950
|
+
if (c === '*') {
|
|
20951
|
+
if (inStar)
|
|
20952
|
+
continue;
|
|
20953
|
+
inStar = true;
|
|
20954
|
+
re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star$1;
|
|
20955
|
+
hasMagic = true;
|
|
20956
|
+
continue;
|
|
20957
|
+
}
|
|
20958
|
+
else {
|
|
20959
|
+
inStar = false;
|
|
20960
|
+
}
|
|
20946
20961
|
if (c === '\\') {
|
|
20947
20962
|
if (i === glob.length - 1) {
|
|
20948
20963
|
re += '\\\\';
|
|
@@ -20962,11 +20977,6 @@ class AST {
|
|
|
20962
20977
|
continue;
|
|
20963
20978
|
}
|
|
20964
20979
|
}
|
|
20965
|
-
if (c === '*') {
|
|
20966
|
-
re += noEmpty && glob === '*' ? starNoEmpty : star$1;
|
|
20967
|
-
hasMagic = true;
|
|
20968
|
-
continue;
|
|
20969
|
-
}
|
|
20970
20980
|
if (c === '?') {
|
|
20971
20981
|
re += qmark$1;
|
|
20972
20982
|
hasMagic = true;
|
|
@@ -20995,12 +21005,12 @@ const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}
|
|
|
20995
21005
|
// that make those magic, and escaping ! as [!] isn't valid,
|
|
20996
21006
|
// because [!]] is a valid glob class meaning not ']'.
|
|
20997
21007
|
if (magicalBraces) {
|
|
20998
|
-
return windowsPathsNoEscape
|
|
20999
|
-
|
|
21008
|
+
return windowsPathsNoEscape ?
|
|
21009
|
+
s.replace(/[?*()[\]{}]/g, '[$&]')
|
|
21000
21010
|
: s.replace(/[?*()[\]\\{}]/g, '\\$&');
|
|
21001
21011
|
}
|
|
21002
|
-
return windowsPathsNoEscape
|
|
21003
|
-
|
|
21012
|
+
return windowsPathsNoEscape ?
|
|
21013
|
+
s.replace(/[?*()[\]]/g, '[$&]')
|
|
21004
21014
|
: s.replace(/[?*()[\]\\]/g, '\\$&');
|
|
21005
21015
|
};
|
|
21006
21016
|
|
|
@@ -21064,8 +21074,8 @@ const qmarksTestNoExtDot = ([$0]) => {
|
|
|
21064
21074
|
return (f) => f.length === len && f !== '.' && f !== '..';
|
|
21065
21075
|
};
|
|
21066
21076
|
/* c8 ignore start */
|
|
21067
|
-
const defaultPlatform = (typeof process === 'object' && process
|
|
21068
|
-
|
|
21077
|
+
const defaultPlatform = (typeof process === 'object' && process ?
|
|
21078
|
+
(typeof process.env === 'object' &&
|
|
21069
21079
|
process.env &&
|
|
21070
21080
|
process.env.__MINIMATCH_TESTING_PLATFORM__) ||
|
|
21071
21081
|
process.platform
|
|
@@ -21149,7 +21159,7 @@ const braceExpand = (pattern, options = {}) => {
|
|
|
21149
21159
|
// shortcut. no need to expand.
|
|
21150
21160
|
return [pattern];
|
|
21151
21161
|
}
|
|
21152
|
-
return expand(pattern);
|
|
21162
|
+
return expand(pattern, { max: options.braceExpandMax });
|
|
21153
21163
|
};
|
|
21154
21164
|
minimatch.braceExpand = braceExpand;
|
|
21155
21165
|
// parse a component of the expanded set.
|
|
@@ -21202,8 +21212,10 @@ class Minimatch {
|
|
|
21202
21212
|
this.pattern = pattern;
|
|
21203
21213
|
this.platform = options.platform || defaultPlatform;
|
|
21204
21214
|
this.isWindows = this.platform === 'win32';
|
|
21215
|
+
// avoid the annoying deprecation flag lol
|
|
21216
|
+
const awe = ('allowWindow' + 'sEscape');
|
|
21205
21217
|
this.windowsPathsNoEscape =
|
|
21206
|
-
!!options.windowsPathsNoEscape || options
|
|
21218
|
+
!!options.windowsPathsNoEscape || options[awe] === false;
|
|
21207
21219
|
if (this.windowsPathsNoEscape) {
|
|
21208
21220
|
this.pattern = this.pattern.replace(/\\/g, '/');
|
|
21209
21221
|
}
|
|
@@ -21216,8 +21228,8 @@ class Minimatch {
|
|
|
21216
21228
|
this.partial = !!options.partial;
|
|
21217
21229
|
this.nocase = !!this.options.nocase;
|
|
21218
21230
|
this.windowsNoMagicRoot =
|
|
21219
|
-
options.windowsNoMagicRoot !== undefined
|
|
21220
|
-
|
|
21231
|
+
options.windowsNoMagicRoot !== undefined ?
|
|
21232
|
+
options.windowsNoMagicRoot
|
|
21221
21233
|
: !!(this.isWindows && this.nocase);
|
|
21222
21234
|
this.globSet = [];
|
|
21223
21235
|
this.globParts = [];
|
|
@@ -21280,7 +21292,10 @@ class Minimatch {
|
|
|
21280
21292
|
!globMagic.test(s[3]);
|
|
21281
21293
|
const isDrive = /^[a-z]:/i.test(s[0]);
|
|
21282
21294
|
if (isUNC) {
|
|
21283
|
-
return [
|
|
21295
|
+
return [
|
|
21296
|
+
...s.slice(0, 4),
|
|
21297
|
+
...s.slice(4).map(ss => this.parse(ss)),
|
|
21298
|
+
];
|
|
21284
21299
|
}
|
|
21285
21300
|
else if (isDrive) {
|
|
21286
21301
|
return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
|
|
@@ -21312,7 +21327,7 @@ class Minimatch {
|
|
|
21312
21327
|
// to the right as possible, even if it increases the number
|
|
21313
21328
|
// of patterns that we have to process.
|
|
21314
21329
|
preprocess(globParts) {
|
|
21315
|
-
// if we're not in globstar mode, then turn
|
|
21330
|
+
// if we're not in globstar mode, then turn ** into *
|
|
21316
21331
|
if (this.options.noglobstar) {
|
|
21317
21332
|
for (let i = 0; i < globParts.length; i++) {
|
|
21318
21333
|
for (let j = 0; j < globParts[i].length; j++) {
|
|
@@ -21616,10 +21631,17 @@ class Minimatch {
|
|
|
21616
21631
|
pattern[2] === '?' &&
|
|
21617
21632
|
typeof pattern[3] === 'string' &&
|
|
21618
21633
|
/^[a-z]:$/i.test(pattern[3]);
|
|
21619
|
-
const fdi = fileUNC ? 3
|
|
21620
|
-
|
|
21634
|
+
const fdi = fileUNC ? 3
|
|
21635
|
+
: fileDrive ? 0
|
|
21636
|
+
: undefined;
|
|
21637
|
+
const pdi = patternUNC ? 3
|
|
21638
|
+
: patternDrive ? 0
|
|
21639
|
+
: undefined;
|
|
21621
21640
|
if (typeof fdi === 'number' && typeof pdi === 'number') {
|
|
21622
|
-
const [fd, pd] = [
|
|
21641
|
+
const [fd, pd] = [
|
|
21642
|
+
file[fdi],
|
|
21643
|
+
pattern[pdi],
|
|
21644
|
+
];
|
|
21623
21645
|
if (fd.toLowerCase() === pd.toLowerCase()) {
|
|
21624
21646
|
pattern[pdi] = fd;
|
|
21625
21647
|
if (pdi > fdi) {
|
|
@@ -21800,21 +21822,19 @@ class Minimatch {
|
|
|
21800
21822
|
fastTest = options.dot ? starTestDot : starTest;
|
|
21801
21823
|
}
|
|
21802
21824
|
else if ((m = pattern.match(starDotExtRE))) {
|
|
21803
|
-
fastTest = (options.nocase
|
|
21804
|
-
|
|
21805
|
-
|
|
21825
|
+
fastTest = (options.nocase ?
|
|
21826
|
+
options.dot ?
|
|
21827
|
+
starDotExtTestNocaseDot
|
|
21806
21828
|
: starDotExtTestNocase
|
|
21807
|
-
: options.dot
|
|
21808
|
-
? starDotExtTestDot
|
|
21829
|
+
: options.dot ? starDotExtTestDot
|
|
21809
21830
|
: starDotExtTest)(m[1]);
|
|
21810
21831
|
}
|
|
21811
21832
|
else if ((m = pattern.match(qmarksRE))) {
|
|
21812
|
-
fastTest = (options.nocase
|
|
21813
|
-
|
|
21814
|
-
|
|
21833
|
+
fastTest = (options.nocase ?
|
|
21834
|
+
options.dot ?
|
|
21835
|
+
qmarksTestNocaseDot
|
|
21815
21836
|
: qmarksTestNocase
|
|
21816
|
-
: options.dot
|
|
21817
|
-
? qmarksTestDot
|
|
21837
|
+
: options.dot ? qmarksTestDot
|
|
21818
21838
|
: qmarksTest)(m);
|
|
21819
21839
|
}
|
|
21820
21840
|
else if ((m = pattern.match(starDotStarRE))) {
|
|
@@ -21845,10 +21865,8 @@ class Minimatch {
|
|
|
21845
21865
|
return this.regexp;
|
|
21846
21866
|
}
|
|
21847
21867
|
const options = this.options;
|
|
21848
|
-
const twoStar = options.noglobstar
|
|
21849
|
-
?
|
|
21850
|
-
: options.dot
|
|
21851
|
-
? twoStarDot
|
|
21868
|
+
const twoStar = options.noglobstar ? star
|
|
21869
|
+
: options.dot ? twoStarDot
|
|
21852
21870
|
: twoStarNoDot;
|
|
21853
21871
|
const flags = new Set(options.nocase ? ['i'] : []);
|
|
21854
21872
|
// regexpify non-globstar patterns
|
|
@@ -21864,11 +21882,9 @@ class Minimatch {
|
|
|
21864
21882
|
for (const f of p.flags.split(''))
|
|
21865
21883
|
flags.add(f);
|
|
21866
21884
|
}
|
|
21867
|
-
return typeof p === 'string'
|
|
21868
|
-
?
|
|
21869
|
-
|
|
21870
|
-
? GLOBSTAR
|
|
21871
|
-
: p._src;
|
|
21885
|
+
return (typeof p === 'string' ? regExpEscape(p)
|
|
21886
|
+
: p === GLOBSTAR ? GLOBSTAR
|
|
21887
|
+
: p._src);
|
|
21872
21888
|
});
|
|
21873
21889
|
pp.forEach((p, i) => {
|
|
21874
21890
|
const next = pp[i + 1];
|
|
@@ -22683,11 +22699,21 @@ function importSourceToScope(ctx, node, scope, source) {
|
|
|
22683
22699
|
}
|
|
22684
22700
|
}
|
|
22685
22701
|
function resolveExt(filename, fs) {
|
|
22686
|
-
|
|
22702
|
+
let moduleType = "u";
|
|
22703
|
+
if (filename.endsWith(".mjs")) {
|
|
22704
|
+
moduleType = "m";
|
|
22705
|
+
} else if (filename.endsWith(".cjs")) {
|
|
22706
|
+
moduleType = "c";
|
|
22707
|
+
}
|
|
22708
|
+
filename = filename.replace(/\.[cm]?jsx?$/, "");
|
|
22687
22709
|
const tryResolve = (filename2) => {
|
|
22688
22710
|
if (fs.fileExists(filename2)) return filename2;
|
|
22689
22711
|
};
|
|
22690
|
-
|
|
22712
|
+
const resolveTs = () => tryResolve(filename + `.ts`) || tryResolve(filename + `.tsx`) || tryResolve(filename + `.d.ts`);
|
|
22713
|
+
const resolveMts = () => tryResolve(filename + `.mts`) || tryResolve(filename + `.d.mts`);
|
|
22714
|
+
const resolveCts = () => tryResolve(filename + `.cts`) || tryResolve(filename + `.d.cts`);
|
|
22715
|
+
return tryResolve(filename) || // For explicit .mjs/.cjs imports, prefer .mts/.cts declarations first.
|
|
22716
|
+
(moduleType === "m" ? resolveMts() || resolveTs() : moduleType === "c" ? resolveCts() || resolveTs() : resolveTs() || resolveMts() || resolveCts()) || tryResolve(joinPaths(filename, `index.ts`)) || tryResolve(joinPaths(filename, `index.tsx`)) || tryResolve(joinPaths(filename, `index.d.ts`));
|
|
22691
22717
|
}
|
|
22692
22718
|
const tsConfigCache = createCache();
|
|
22693
22719
|
const tsConfigRefMap = /* @__PURE__ */ new Map();
|
|
@@ -22803,12 +22829,12 @@ function fileToScope(ctx, filename, asGlobal = false) {
|
|
|
22803
22829
|
}
|
|
22804
22830
|
function parseFile(filename, content, fs, parserPlugins) {
|
|
22805
22831
|
const ext = path$1.extname(filename);
|
|
22806
|
-
if (ext === ".ts" || ext === ".mts" || ext === ".tsx" || ext === ".mtsx") {
|
|
22832
|
+
if (ext === ".ts" || ext === ".mts" || ext === ".tsx" || ext === ".cts" || ext === ".mtsx") {
|
|
22807
22833
|
return parser$2.parse(content, {
|
|
22808
22834
|
plugins: resolveParserPlugins(
|
|
22809
22835
|
ext.slice(1),
|
|
22810
22836
|
parserPlugins,
|
|
22811
|
-
/\.d\.
|
|
22837
|
+
/\.d\.[cm]?ts$/.test(filename)
|
|
22812
22838
|
),
|
|
22813
22839
|
sourceType: "module"
|
|
22814
22840
|
}).program.body;
|
|
@@ -23821,7 +23847,13 @@ function genRuntimePropFromType(ctx, { key, required, type, skipCheck }, hasStat
|
|
|
23821
23847
|
if (prop.type === "ObjectProperty") {
|
|
23822
23848
|
defaultString = `default: ${ctx.getString(prop.value)}`;
|
|
23823
23849
|
} else {
|
|
23824
|
-
|
|
23850
|
+
let paramsString = "";
|
|
23851
|
+
if (prop.params.length) {
|
|
23852
|
+
const start = prop.params[0].start;
|
|
23853
|
+
const end = prop.params[prop.params.length - 1].end;
|
|
23854
|
+
paramsString = ctx.getString({ start, end });
|
|
23855
|
+
}
|
|
23856
|
+
defaultString = `${prop.async ? "async " : ""}${prop.kind !== "method" ? `${prop.kind} ` : ""}default(${paramsString}) ${ctx.getString(prop.body)}`;
|
|
23825
23857
|
}
|
|
23826
23858
|
}
|
|
23827
23859
|
}
|
|
@@ -25181,7 +25213,7 @@ function mergeSourceMaps(scriptMap, templateMap, templateLineOffset) {
|
|
|
25181
25213
|
return generator.toJSON();
|
|
25182
25214
|
}
|
|
25183
25215
|
|
|
25184
|
-
const version = "3.5.
|
|
25216
|
+
const version = "3.5.29";
|
|
25185
25217
|
const parseCache = parseCache$1;
|
|
25186
25218
|
const errorMessages = {
|
|
25187
25219
|
...CompilerDOM.errorMessages,
|