@vue/compiler-sfc 3.5.16 → 3.5.18

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-sfc v3.5.16
2
+ * @vue/compiler-sfc v3.5.18
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -127,7 +127,14 @@ const CSS_VARS_HELPER = `useCssVars`;
127
127
  function genCssVarsFromList(vars, id, isProd, isSSR = false) {
128
128
  return `{
129
129
  ${vars.map(
130
- (key) => `"${isSSR ? `--` : ``}${genVarName(id, key, isProd, isSSR)}": (${key})`
130
+ (key) => (
131
+ // The `:` prefix here is used in `ssrRenderStyle` to distinguish whether
132
+ // a custom property comes from `ssrCssVars`. If it does, we need to reset
133
+ // its value to `initial` on the component instance to avoid unintentionally
134
+ // inheriting the same property value from a different instance of the same
135
+ // component in the outer scope.
136
+ `"${isSSR ? `:--` : ``}${genVarName(id, key, isProd, isSSR)}": (${key})`
137
+ )
131
138
  ).join(",\n ")}
132
139
  }`;
133
140
  }
@@ -2213,7 +2220,7 @@ const transformSrcset = (node, context, options = defaultAssetUrlOptions) => {
2213
2220
  }
2214
2221
  }
2215
2222
  const shouldProcessUrl = (url) => {
2216
- return !isExternalUrl(url) && !isDataUrl(url) && (options.includeAbsolute || isRelativeUrl(url));
2223
+ return url && !isExternalUrl(url) && !isDataUrl(url) && (options.includeAbsolute || isRelativeUrl(url));
2217
2224
  };
2218
2225
  if (!imageCandidates.some(({ url }) => shouldProcessUrl(url))) {
2219
2226
  return;
@@ -7980,6 +7987,7 @@ var selectorParser = /*@__PURE__*/getDefaultExportFromCjs(distExports);
7980
7987
 
7981
7988
  const animationNameRE = /^(-\w+-)?animation-name$/;
7982
7989
  const animationRE = /^(-\w+-)?animation$/;
7990
+ const keyframesRE = /^(?:-\w+-)?keyframes$/;
7983
7991
  const scopedPlugin = (id = "") => {
7984
7992
  const keyframes = /* @__PURE__ */ Object.create(null);
7985
7993
  const shortId = id.replace(/^data-v-/, "");
@@ -7989,7 +7997,7 @@ const scopedPlugin = (id = "") => {
7989
7997
  processRule(id, rule);
7990
7998
  },
7991
7999
  AtRule(node) {
7992
- if (/-?keyframes$/.test(node.name) && !node.params.endsWith(`-${shortId}`)) {
8000
+ if (keyframesRE.test(node.name) && !node.params.endsWith(`-${shortId}`)) {
7993
8001
  keyframes[node.params] = node.params = node.params + "-" + shortId;
7994
8002
  }
7995
8003
  },
@@ -8018,7 +8026,7 @@ const scopedPlugin = (id = "") => {
8018
8026
  };
8019
8027
  const processedRules = /* @__PURE__ */ new WeakSet();
8020
8028
  function processRule(id, rule) {
8021
- if (processedRules.has(rule) || rule.parent && rule.parent.type === "atrule" && /-?keyframes$/.test(rule.parent.name)) {
8029
+ if (processedRules.has(rule) || rule.parent && rule.parent.type === "atrule" && keyframesRE.test(rule.parent.name)) {
8022
8030
  return;
8023
8031
  }
8024
8032
  processedRules.add(rule);
@@ -12416,7 +12424,7 @@ function requireLodash_camelcase () {
12416
12424
  function castSlice(array, start, end) {
12417
12425
  var length = array.length;
12418
12426
  end = end === undefined ? length : end;
12419
- return (false && end >= length) ? array : baseSlice(array, start, end);
12427
+ return (!start && end >= length) ? array : baseSlice(array, start, end);
12420
12428
  }
12421
12429
 
12422
12430
  /**
@@ -19923,289 +19931,250 @@ export default ${defaultVar}`;
19923
19931
  }
19924
19932
  }
19925
19933
 
19926
- var balancedMatch;
19927
- var hasRequiredBalancedMatch;
19928
-
19929
- function requireBalancedMatch () {
19930
- if (hasRequiredBalancedMatch) return balancedMatch;
19931
- hasRequiredBalancedMatch = 1;
19932
- balancedMatch = balanced;
19933
- function balanced(a, b, str) {
19934
- if (a instanceof RegExp) a = maybeMatch(a, str);
19935
- if (b instanceof RegExp) b = maybeMatch(b, str);
19936
-
19937
- var r = range(a, b, str);
19938
-
19939
- return r && {
19940
- start: r[0],
19941
- end: r[1],
19942
- pre: str.slice(0, r[0]),
19943
- body: str.slice(r[0] + a.length, r[1]),
19944
- post: str.slice(r[1] + b.length)
19945
- };
19946
- }
19947
-
19948
- function maybeMatch(reg, str) {
19949
- var m = str.match(reg);
19950
- return m ? m[0] : null;
19951
- }
19952
-
19953
- balanced.range = range;
19954
- function range(a, b, str) {
19955
- var begs, beg, left, right, result;
19956
- var ai = str.indexOf(a);
19957
- var bi = str.indexOf(b, ai + 1);
19958
- var i = ai;
19959
-
19960
- if (ai >= 0 && bi > 0) {
19961
- if(a===b) {
19962
- return [ai, bi];
19963
- }
19964
- begs = [];
19965
- left = str.length;
19966
-
19967
- while (i >= 0 && !result) {
19968
- if (i == ai) {
19969
- begs.push(i);
19970
- ai = str.indexOf(a, i + 1);
19971
- } else if (begs.length == 1) {
19972
- result = [ begs.pop(), bi ];
19973
- } else {
19974
- beg = begs.pop();
19975
- if (beg < left) {
19976
- left = beg;
19977
- right = bi;
19978
- }
19979
-
19980
- bi = str.indexOf(b, i + 1);
19981
- }
19982
-
19983
- i = ai < bi && ai >= 0 ? ai : bi;
19984
- }
19985
-
19986
- if (begs.length) {
19987
- result = [ left, right ];
19988
- }
19989
- }
19934
+ const balanced = (a, b, str) => {
19935
+ const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
19936
+ const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
19937
+ const r = ma !== null && mb != null && range(ma, mb, str);
19938
+ return (r && {
19939
+ start: r[0],
19940
+ end: r[1],
19941
+ pre: str.slice(0, r[0]),
19942
+ body: str.slice(r[0] + ma.length, r[1]),
19943
+ post: str.slice(r[1] + mb.length),
19944
+ });
19945
+ };
19946
+ const maybeMatch = (reg, str) => {
19947
+ const m = str.match(reg);
19948
+ return m ? m[0] : null;
19949
+ };
19950
+ const range = (a, b, str) => {
19951
+ let begs, beg, left, right = undefined, result;
19952
+ let ai = str.indexOf(a);
19953
+ let bi = str.indexOf(b, ai + 1);
19954
+ let i = ai;
19955
+ if (ai >= 0 && bi > 0) {
19956
+ if (a === b) {
19957
+ return [ai, bi];
19958
+ }
19959
+ begs = [];
19960
+ left = str.length;
19961
+ while (i >= 0 && !result) {
19962
+ if (i === ai) {
19963
+ begs.push(i);
19964
+ ai = str.indexOf(a, i + 1);
19965
+ }
19966
+ else if (begs.length === 1) {
19967
+ const r = begs.pop();
19968
+ if (r !== undefined)
19969
+ result = [r, bi];
19970
+ }
19971
+ else {
19972
+ beg = begs.pop();
19973
+ if (beg !== undefined && beg < left) {
19974
+ left = beg;
19975
+ right = bi;
19976
+ }
19977
+ bi = str.indexOf(b, i + 1);
19978
+ }
19979
+ i = ai < bi && ai >= 0 ? ai : bi;
19980
+ }
19981
+ if (begs.length && right !== undefined) {
19982
+ result = [left, right];
19983
+ }
19984
+ }
19985
+ return result;
19986
+ };
19990
19987
 
19991
- return result;
19992
- }
19993
- return balancedMatch;
19988
+ const escSlash = '\0SLASH' + Math.random() + '\0';
19989
+ const escOpen = '\0OPEN' + Math.random() + '\0';
19990
+ const escClose = '\0CLOSE' + Math.random() + '\0';
19991
+ const escComma = '\0COMMA' + Math.random() + '\0';
19992
+ const escPeriod = '\0PERIOD' + Math.random() + '\0';
19993
+ const escSlashPattern = new RegExp(escSlash, 'g');
19994
+ const escOpenPattern = new RegExp(escOpen, 'g');
19995
+ const escClosePattern = new RegExp(escClose, 'g');
19996
+ const escCommaPattern = new RegExp(escComma, 'g');
19997
+ const escPeriodPattern = new RegExp(escPeriod, 'g');
19998
+ const slashPattern = /\\\\/g;
19999
+ const openPattern = /\\{/g;
20000
+ const closePattern = /\\}/g;
20001
+ const commaPattern = /\\,/g;
20002
+ const periodPattern = /\\./g;
20003
+ function numeric(str) {
20004
+ return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
20005
+ }
20006
+ function escapeBraces(str) {
20007
+ return str
20008
+ .replace(slashPattern, escSlash)
20009
+ .replace(openPattern, escOpen)
20010
+ .replace(closePattern, escClose)
20011
+ .replace(commaPattern, escComma)
20012
+ .replace(periodPattern, escPeriod);
20013
+ }
20014
+ function unescapeBraces(str) {
20015
+ return str
20016
+ .replace(escSlashPattern, '\\')
20017
+ .replace(escOpenPattern, '{')
20018
+ .replace(escClosePattern, '}')
20019
+ .replace(escCommaPattern, ',')
20020
+ .replace(escPeriodPattern, '.');
19994
20021
  }
19995
-
19996
- var braceExpansion;
19997
- var hasRequiredBraceExpansion;
19998
-
19999
- function requireBraceExpansion () {
20000
- if (hasRequiredBraceExpansion) return braceExpansion;
20001
- hasRequiredBraceExpansion = 1;
20002
- var balanced = /*@__PURE__*/ requireBalancedMatch();
20003
-
20004
- braceExpansion = expandTop;
20005
-
20006
- var escSlash = '\0SLASH'+Math.random()+'\0';
20007
- var escOpen = '\0OPEN'+Math.random()+'\0';
20008
- var escClose = '\0CLOSE'+Math.random()+'\0';
20009
- var escComma = '\0COMMA'+Math.random()+'\0';
20010
- var escPeriod = '\0PERIOD'+Math.random()+'\0';
20011
-
20012
- function numeric(str) {
20013
- return parseInt(str, 10) == str
20014
- ? parseInt(str, 10)
20015
- : str.charCodeAt(0);
20016
- }
20017
-
20018
- function escapeBraces(str) {
20019
- return str.split('\\\\').join(escSlash)
20020
- .split('\\{').join(escOpen)
20021
- .split('\\}').join(escClose)
20022
- .split('\\,').join(escComma)
20023
- .split('\\.').join(escPeriod);
20024
- }
20025
-
20026
- function unescapeBraces(str) {
20027
- return str.split(escSlash).join('\\')
20028
- .split(escOpen).join('{')
20029
- .split(escClose).join('}')
20030
- .split(escComma).join(',')
20031
- .split(escPeriod).join('.');
20032
- }
20033
-
20034
-
20035
- // Basically just str.split(","), but handling cases
20036
- // where we have nested braced sections, which should be
20037
- // treated as individual members, like {a,{b,c},d}
20038
- function parseCommaParts(str) {
20039
- if (!str)
20040
- return [''];
20041
-
20042
- var parts = [];
20043
- var m = balanced('{', '}', str);
20044
-
20045
- if (!m)
20046
- return str.split(',');
20047
-
20048
- var pre = m.pre;
20049
- var body = m.body;
20050
- var post = m.post;
20051
- var p = pre.split(',');
20052
-
20053
- p[p.length-1] += '{' + body + '}';
20054
- var postParts = parseCommaParts(post);
20055
- if (post.length) {
20056
- p[p.length-1] += postParts.shift();
20057
- p.push.apply(p, postParts);
20058
- }
20059
-
20060
- parts.push.apply(parts, p);
20061
-
20062
- return parts;
20063
- }
20064
-
20065
- function expandTop(str) {
20066
- if (!str)
20067
- return [];
20068
-
20069
- // I don't know why Bash 4.3 does this, but it does.
20070
- // Anything starting with {} will have the first two bytes preserved
20071
- // but *only* at the top level, so {},a}b will not expand to anything,
20072
- // but a{},b}c will be expanded to [a}c,abc].
20073
- // One could argue that this is a bug in Bash, but since the goal of
20074
- // this module is to match Bash's rules, we escape a leading {}
20075
- if (str.substr(0, 2) === '{}') {
20076
- str = '\\{\\}' + str.substr(2);
20077
- }
20078
-
20079
- return expand(escapeBraces(str), true).map(unescapeBraces);
20080
- }
20081
-
20082
- function embrace(str) {
20083
- return '{' + str + '}';
20084
- }
20085
- function isPadded(el) {
20086
- return /^-?0\d/.test(el);
20087
- }
20088
-
20089
- function lte(i, y) {
20090
- return i <= y;
20091
- }
20092
- function gte(i, y) {
20093
- return i >= y;
20094
- }
20095
-
20096
- function expand(str, isTop) {
20097
- var expansions = [];
20098
-
20099
- var m = balanced('{', '}', str);
20100
- if (!m) return [str];
20101
-
20102
- // no need to expand pre, since it is guaranteed to be free of brace-sets
20103
- var pre = m.pre;
20104
- var post = m.post.length
20105
- ? expand(m.post, false)
20106
- : [''];
20107
-
20108
- if (/\$$/.test(m.pre)) {
20109
- for (var k = 0; k < post.length; k++) {
20110
- var expansion = pre+ '{' + m.body + '}' + post[k];
20111
- expansions.push(expansion);
20112
- }
20113
- } else {
20114
- var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
20115
- var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
20116
- var isSequence = isNumericSequence || isAlphaSequence;
20117
- var isOptions = m.body.indexOf(',') >= 0;
20118
- if (!isSequence && !isOptions) {
20119
- // {a},b}
20120
- if (m.post.match(/,.*\}/)) {
20121
- str = m.pre + '{' + m.body + escClose + m.post;
20122
- return expand(str);
20123
- }
20124
- return [str];
20125
- }
20126
-
20127
- var n;
20128
- if (isSequence) {
20129
- n = m.body.split(/\.\./);
20130
- } else {
20131
- n = parseCommaParts(m.body);
20132
- if (n.length === 1) {
20133
- // x{{a,b}}y ==> x{a}y x{b}y
20134
- n = expand(n[0], false).map(embrace);
20135
- if (n.length === 1) {
20136
- return post.map(function(p) {
20137
- return m.pre + n[0] + p;
20138
- });
20139
- }
20140
- }
20141
- }
20142
-
20143
- // at this point, n is the parts, and we know it's not a comma set
20144
- // with a single entry.
20145
- var N;
20146
-
20147
- if (isSequence) {
20148
- var x = numeric(n[0]);
20149
- var y = numeric(n[1]);
20150
- var width = Math.max(n[0].length, n[1].length);
20151
- var incr = n.length == 3
20152
- ? Math.abs(numeric(n[2]))
20153
- : 1;
20154
- var test = lte;
20155
- var reverse = y < x;
20156
- if (reverse) {
20157
- incr *= -1;
20158
- test = gte;
20159
- }
20160
- var pad = n.some(isPadded);
20161
-
20162
- N = [];
20163
-
20164
- for (var i = x; test(i, y); i += incr) {
20165
- var c;
20166
- if (isAlphaSequence) {
20167
- c = String.fromCharCode(i);
20168
- if (c === '\\')
20169
- c = '';
20170
- } else {
20171
- c = String(i);
20172
- if (pad) {
20173
- var need = width - c.length;
20174
- if (need > 0) {
20175
- var z = new Array(need + 1).join('0');
20176
- if (i < 0)
20177
- c = '-' + z + c.slice(1);
20178
- else
20179
- c = z + c;
20180
- }
20181
- }
20182
- }
20183
- N.push(c);
20184
- }
20185
- } else {
20186
- N = [];
20187
-
20188
- for (var j = 0; j < n.length; j++) {
20189
- N.push.apply(N, expand(n[j], false));
20190
- }
20191
- }
20192
-
20193
- for (var j = 0; j < N.length; j++) {
20194
- for (var k = 0; k < post.length; k++) {
20195
- var expansion = pre + N[j] + post[k];
20196
- if (!isTop || isSequence || expansion)
20197
- expansions.push(expansion);
20198
- }
20199
- }
20200
- }
20201
-
20202
- return expansions;
20203
- }
20204
- return braceExpansion;
20022
+ /**
20023
+ * Basically just str.split(","), but handling cases
20024
+ * where we have nested braced sections, which should be
20025
+ * treated as individual members, like {a,{b,c},d}
20026
+ */
20027
+ function parseCommaParts(str) {
20028
+ if (!str) {
20029
+ return [''];
20030
+ }
20031
+ const parts = [];
20032
+ const m = balanced('{', '}', str);
20033
+ if (!m) {
20034
+ return str.split(',');
20035
+ }
20036
+ const { pre, body, post } = m;
20037
+ const p = pre.split(',');
20038
+ p[p.length - 1] += '{' + body + '}';
20039
+ const postParts = parseCommaParts(post);
20040
+ if (post.length) {
20041
+ p[p.length - 1] += postParts.shift();
20042
+ p.push.apply(p, postParts);
20043
+ }
20044
+ parts.push.apply(parts, p);
20045
+ return parts;
20046
+ }
20047
+ function expand(str) {
20048
+ if (!str) {
20049
+ return [];
20050
+ }
20051
+ // I don't know why Bash 4.3 does this, but it does.
20052
+ // Anything starting with {} will have the first two bytes preserved
20053
+ // but *only* at the top level, so {},a}b will not expand to anything,
20054
+ // but a{},b}c will be expanded to [a}c,abc].
20055
+ // One could argue that this is a bug in Bash, but since the goal of
20056
+ // this module is to match Bash's rules, we escape a leading {}
20057
+ if (str.slice(0, 2) === '{}') {
20058
+ str = '\\{\\}' + str.slice(2);
20059
+ }
20060
+ return expand_(escapeBraces(str), true).map(unescapeBraces);
20061
+ }
20062
+ function embrace(str) {
20063
+ return '{' + str + '}';
20064
+ }
20065
+ function isPadded(el) {
20066
+ return /^-?0\d/.test(el);
20067
+ }
20068
+ function lte(i, y) {
20069
+ return i <= y;
20070
+ }
20071
+ function gte(i, y) {
20072
+ return i >= y;
20073
+ }
20074
+ function expand_(str, isTop) {
20075
+ /** @type {string[]} */
20076
+ const expansions = [];
20077
+ const m = balanced('{', '}', str);
20078
+ if (!m)
20079
+ return [str];
20080
+ // no need to expand pre, since it is guaranteed to be free of brace-sets
20081
+ const pre = m.pre;
20082
+ const post = m.post.length ? expand_(m.post, false) : [''];
20083
+ if (/\$$/.test(m.pre)) {
20084
+ for (let k = 0; k < post.length; k++) {
20085
+ const expansion = pre + '{' + m.body + '}' + post[k];
20086
+ expansions.push(expansion);
20087
+ }
20088
+ }
20089
+ else {
20090
+ const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
20091
+ const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
20092
+ const isSequence = isNumericSequence || isAlphaSequence;
20093
+ const isOptions = m.body.indexOf(',') >= 0;
20094
+ if (!isSequence && !isOptions) {
20095
+ // {a},b}
20096
+ if (m.post.match(/,(?!,).*\}/)) {
20097
+ str = m.pre + '{' + m.body + escClose + m.post;
20098
+ return expand_(str);
20099
+ }
20100
+ return [str];
20101
+ }
20102
+ let n;
20103
+ if (isSequence) {
20104
+ n = m.body.split(/\.\./);
20105
+ }
20106
+ else {
20107
+ n = parseCommaParts(m.body);
20108
+ if (n.length === 1 && n[0] !== undefined) {
20109
+ // x{{a,b}}y ==> x{a}y x{b}y
20110
+ n = expand_(n[0], false).map(embrace);
20111
+ //XXX is this necessary? Can't seem to hit it in tests.
20112
+ /* c8 ignore start */
20113
+ if (n.length === 1) {
20114
+ return post.map(p => m.pre + n[0] + p);
20115
+ }
20116
+ /* c8 ignore stop */
20117
+ }
20118
+ }
20119
+ // at this point, n is the parts, and we know it's not a comma set
20120
+ // with a single entry.
20121
+ let N;
20122
+ if (isSequence && n[0] !== undefined && n[1] !== undefined) {
20123
+ const x = numeric(n[0]);
20124
+ const y = numeric(n[1]);
20125
+ const width = Math.max(n[0].length, n[1].length);
20126
+ let incr = n.length === 3 && n[2] !== undefined ? Math.abs(numeric(n[2])) : 1;
20127
+ let test = lte;
20128
+ const reverse = y < x;
20129
+ if (reverse) {
20130
+ incr *= -1;
20131
+ test = gte;
20132
+ }
20133
+ const pad = n.some(isPadded);
20134
+ N = [];
20135
+ for (let i = x; test(i, y); i += incr) {
20136
+ let c;
20137
+ if (isAlphaSequence) {
20138
+ c = String.fromCharCode(i);
20139
+ if (c === '\\') {
20140
+ c = '';
20141
+ }
20142
+ }
20143
+ else {
20144
+ c = String(i);
20145
+ if (pad) {
20146
+ const need = width - c.length;
20147
+ if (need > 0) {
20148
+ const z = new Array(need + 1).join('0');
20149
+ if (i < 0) {
20150
+ c = '-' + z + c.slice(1);
20151
+ }
20152
+ else {
20153
+ c = z + c;
20154
+ }
20155
+ }
20156
+ }
20157
+ }
20158
+ N.push(c);
20159
+ }
20160
+ }
20161
+ else {
20162
+ N = [];
20163
+ for (let j = 0; j < n.length; j++) {
20164
+ N.push.apply(N, expand_(n[j], false));
20165
+ }
20166
+ }
20167
+ for (let j = 0; j < N.length; j++) {
20168
+ for (let k = 0; k < post.length; k++) {
20169
+ const expansion = pre + N[j] + post[k];
20170
+ if (!isTop || isSequence || expansion) {
20171
+ expansions.push(expansion);
20172
+ }
20173
+ }
20174
+ }
20175
+ }
20176
+ return expansions;
20205
20177
  }
20206
-
20207
- var braceExpansionExports = /*@__PURE__*/ requireBraceExpansion();
20208
- var expand = /*@__PURE__*/getDefaultExportFromCjs(braceExpansionExports);
20209
20178
 
20210
20179
  const MAX_PATTERN_LENGTH = 1024 * 64;
20211
20180
  const assertValidPattern = (pattern) => {
@@ -20866,7 +20835,7 @@ class AST {
20866
20835
  return [s, unescape(this.toString()), false, false];
20867
20836
  }
20868
20837
  // XXX abstract out this map method
20869
- let bodyDotAllowed = !repeated || allowDot || dot || false
20838
+ let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot
20870
20839
  ? ''
20871
20840
  : this.#partsToRegExp(true);
20872
20841
  if (bodyDotAllowed === body) {
@@ -22326,25 +22295,39 @@ function resolveArrayElementType(ctx, node, scope) {
22326
22295
  scope
22327
22296
  );
22328
22297
  }
22329
- function resolveStringType(ctx, node, scope) {
22298
+ function resolveStringType(ctx, node, scope, typeParameters) {
22330
22299
  switch (node.type) {
22331
22300
  case "StringLiteral":
22332
22301
  return [node.value];
22333
22302
  case "TSLiteralType":
22334
- return resolveStringType(ctx, node.literal, scope);
22303
+ return resolveStringType(ctx, node.literal, scope, typeParameters);
22335
22304
  case "TSUnionType":
22336
- return node.types.map((t) => resolveStringType(ctx, t, scope)).flat();
22305
+ return node.types.map((t) => resolveStringType(ctx, t, scope, typeParameters)).flat();
22337
22306
  case "TemplateLiteral": {
22338
22307
  return resolveTemplateKeys(ctx, node, scope);
22339
22308
  }
22340
22309
  case "TSTypeReference": {
22341
22310
  const resolved = resolveTypeReference(ctx, node, scope);
22342
22311
  if (resolved) {
22343
- return resolveStringType(ctx, resolved, scope);
22312
+ return resolveStringType(ctx, resolved, scope, typeParameters);
22344
22313
  }
22345
22314
  if (node.typeName.type === "Identifier") {
22346
- const getParam = (index = 0) => resolveStringType(ctx, node.typeParameters.params[index], scope);
22347
- switch (node.typeName.name) {
22315
+ const name = node.typeName.name;
22316
+ if (typeParameters && typeParameters[name]) {
22317
+ return resolveStringType(
22318
+ ctx,
22319
+ typeParameters[name],
22320
+ scope,
22321
+ typeParameters
22322
+ );
22323
+ }
22324
+ const getParam = (index = 0) => resolveStringType(
22325
+ ctx,
22326
+ node.typeParameters.params[index],
22327
+ scope,
22328
+ typeParameters
22329
+ );
22330
+ switch (name) {
22348
22331
  case "Extract":
22349
22332
  return getParam(1);
22350
22333
  case "Exclude": {
@@ -22431,7 +22414,8 @@ function resolveBuiltin(ctx, node, name, scope, typeParameters) {
22431
22414
  const picked = resolveStringType(
22432
22415
  ctx,
22433
22416
  node.typeParameters.params[1],
22434
- scope
22417
+ scope,
22418
+ typeParameters
22435
22419
  );
22436
22420
  const res2 = { props: {}, calls: t.calls };
22437
22421
  for (const key of picked) {
@@ -22443,7 +22427,8 @@ function resolveBuiltin(ctx, node, name, scope, typeParameters) {
22443
22427
  const omitted = resolveStringType(
22444
22428
  ctx,
22445
22429
  node.typeParameters.params[1],
22446
- scope
22430
+ scope,
22431
+ typeParameters
22447
22432
  );
22448
22433
  const res = { props: {}, calls: t.calls };
22449
22434
  for (const key in t.props) {
@@ -23094,13 +23079,8 @@ function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx)
23094
23079
  case "TSTypeReference": {
23095
23080
  const resolved = resolveTypeReference(ctx, node, scope);
23096
23081
  if (resolved) {
23097
- if (resolved.type === "TSTypeAliasDeclaration") {
23098
- return inferRuntimeType(
23099
- ctx,
23100
- resolved.typeAnnotation,
23101
- resolved._ownerScope,
23102
- isKeyOf
23103
- );
23082
+ if (resolved.type === "TSTypeAliasDeclaration" && resolved.typeAnnotation.type === "TSFunctionType") {
23083
+ return ["Function"];
23104
23084
  }
23105
23085
  return inferRuntimeType(ctx, resolved, resolved._ownerScope, isKeyOf);
23106
23086
  }
@@ -25002,7 +24982,7 @@ function mergeSourceMaps(scriptMap, templateMap, templateLineOffset) {
25002
24982
  return generator.toJSON();
25003
24983
  }
25004
24984
 
25005
- const version = "3.5.16";
24985
+ const version = "3.5.18";
25006
24986
  const parseCache = parseCache$1;
25007
24987
  const errorMessages = {
25008
24988
  ...CompilerDOM.errorMessages,