@powerlines/deepkit 0.6.156 → 0.6.158

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.
@@ -1263,13 +1263,14 @@ var require_braces = __commonJS({
1263
1263
  }
1264
1264
  });
1265
1265
 
1266
- // ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
1266
+ // ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/constants.js
1267
1267
  var require_constants2 = __commonJS({
1268
- "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js"(exports$1, module) {
1268
+ "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/constants.js"(exports$1, module) {
1269
1269
  init_esm_shims();
1270
1270
  var path = __require("path");
1271
1271
  var WIN_SLASH = "\\\\/";
1272
1272
  var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
1273
+ var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
1273
1274
  var DOT_LITERAL = "\\.";
1274
1275
  var PLUS_LITERAL = "\\+";
1275
1276
  var QMARK_LITERAL = "\\?";
@@ -1317,6 +1318,7 @@ var require_constants2 = __commonJS({
1317
1318
  END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
1318
1319
  };
1319
1320
  var POSIX_REGEX_SOURCE = {
1321
+ __proto__: null,
1320
1322
  alnum: "a-zA-Z0-9",
1321
1323
  alpha: "a-zA-Z",
1322
1324
  ascii: "\\x00-\\x7F",
@@ -1333,6 +1335,7 @@ var require_constants2 = __commonJS({
1333
1335
  xdigit: "A-Fa-f0-9"
1334
1336
  };
1335
1337
  module.exports = {
1338
+ DEFAULT_MAX_EXTGLOB_RECURSION,
1336
1339
  MAX_LENGTH: 1024 * 64,
1337
1340
  POSIX_REGEX_SOURCE,
1338
1341
  // regular expressions
@@ -1344,6 +1347,7 @@ var require_constants2 = __commonJS({
1344
1347
  REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
1345
1348
  // Replace globs with equivalent patterns to reduce parsing time.
1346
1349
  REPLACEMENTS: {
1350
+ __proto__: null,
1347
1351
  "***": "*",
1348
1352
  "**/**": "**",
1349
1353
  "**/**/**": "**"
@@ -1480,9 +1484,9 @@ var require_constants2 = __commonJS({
1480
1484
  }
1481
1485
  });
1482
1486
 
1483
- // ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js
1487
+ // ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/utils.js
1484
1488
  var require_utils2 = __commonJS({
1485
- "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js"(exports$1) {
1489
+ "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/utils.js"(exports$1) {
1486
1490
  init_esm_shims();
1487
1491
  var path = __require("path");
1488
1492
  var win32 = process.platform === "win32";
@@ -1536,9 +1540,9 @@ var require_utils2 = __commonJS({
1536
1540
  }
1537
1541
  });
1538
1542
 
1539
- // ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.js
1543
+ // ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/scan.js
1540
1544
  var require_scan = __commonJS({
1541
- "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.js"(exports$1, module) {
1545
+ "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/scan.js"(exports$1, module) {
1542
1546
  init_esm_shims();
1543
1547
  var utils = require_utils2();
1544
1548
  var {
@@ -1874,9 +1878,9 @@ var require_scan = __commonJS({
1874
1878
  }
1875
1879
  });
1876
1880
 
1877
- // ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js
1881
+ // ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/parse.js
1878
1882
  var require_parse2 = __commonJS({
1879
- "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js"(exports$1, module) {
1883
+ "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/parse.js"(exports$1, module) {
1880
1884
  init_esm_shims();
1881
1885
  var constants = require_constants2();
1882
1886
  var utils = require_utils2();
@@ -1897,6 +1901,224 @@ var require_parse2 = __commonJS({
1897
1901
  var syntaxError = /* @__PURE__ */ __name((type, char) => {
1898
1902
  return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
1899
1903
  }, "syntaxError");
1904
+ var splitTopLevel = /* @__PURE__ */ __name((input) => {
1905
+ const parts = [];
1906
+ let bracket = 0;
1907
+ let paren = 0;
1908
+ let quote = 0;
1909
+ let value = "";
1910
+ let escaped = false;
1911
+ for (const ch of input) {
1912
+ if (escaped === true) {
1913
+ value += ch;
1914
+ escaped = false;
1915
+ continue;
1916
+ }
1917
+ if (ch === "\\") {
1918
+ value += ch;
1919
+ escaped = true;
1920
+ continue;
1921
+ }
1922
+ if (ch === '"') {
1923
+ quote = quote === 1 ? 0 : 1;
1924
+ value += ch;
1925
+ continue;
1926
+ }
1927
+ if (quote === 0) {
1928
+ if (ch === "[") {
1929
+ bracket++;
1930
+ } else if (ch === "]" && bracket > 0) {
1931
+ bracket--;
1932
+ } else if (bracket === 0) {
1933
+ if (ch === "(") {
1934
+ paren++;
1935
+ } else if (ch === ")" && paren > 0) {
1936
+ paren--;
1937
+ } else if (ch === "|" && paren === 0) {
1938
+ parts.push(value);
1939
+ value = "";
1940
+ continue;
1941
+ }
1942
+ }
1943
+ }
1944
+ value += ch;
1945
+ }
1946
+ parts.push(value);
1947
+ return parts;
1948
+ }, "splitTopLevel");
1949
+ var isPlainBranch = /* @__PURE__ */ __name((branch) => {
1950
+ let escaped = false;
1951
+ for (const ch of branch) {
1952
+ if (escaped === true) {
1953
+ escaped = false;
1954
+ continue;
1955
+ }
1956
+ if (ch === "\\") {
1957
+ escaped = true;
1958
+ continue;
1959
+ }
1960
+ if (/[?*+@!()[\]{}]/.test(ch)) {
1961
+ return false;
1962
+ }
1963
+ }
1964
+ return true;
1965
+ }, "isPlainBranch");
1966
+ var normalizeSimpleBranch = /* @__PURE__ */ __name((branch) => {
1967
+ let value = branch.trim();
1968
+ let changed = true;
1969
+ while (changed === true) {
1970
+ changed = false;
1971
+ if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
1972
+ value = value.slice(2, -1);
1973
+ changed = true;
1974
+ }
1975
+ }
1976
+ if (!isPlainBranch(value)) {
1977
+ return;
1978
+ }
1979
+ return value.replace(/\\(.)/g, "$1");
1980
+ }, "normalizeSimpleBranch");
1981
+ var hasRepeatedCharPrefixOverlap = /* @__PURE__ */ __name((branches) => {
1982
+ const values = branches.map(normalizeSimpleBranch).filter(Boolean);
1983
+ for (let i = 0; i < values.length; i++) {
1984
+ for (let j = i + 1; j < values.length; j++) {
1985
+ const a = values[i];
1986
+ const b = values[j];
1987
+ const char = a[0];
1988
+ if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
1989
+ continue;
1990
+ }
1991
+ if (a === b || a.startsWith(b) || b.startsWith(a)) {
1992
+ return true;
1993
+ }
1994
+ }
1995
+ }
1996
+ return false;
1997
+ }, "hasRepeatedCharPrefixOverlap");
1998
+ var parseRepeatedExtglob = /* @__PURE__ */ __name((pattern, requireEnd = true) => {
1999
+ if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
2000
+ return;
2001
+ }
2002
+ let bracket = 0;
2003
+ let paren = 0;
2004
+ let quote = 0;
2005
+ let escaped = false;
2006
+ for (let i = 1; i < pattern.length; i++) {
2007
+ const ch = pattern[i];
2008
+ if (escaped === true) {
2009
+ escaped = false;
2010
+ continue;
2011
+ }
2012
+ if (ch === "\\") {
2013
+ escaped = true;
2014
+ continue;
2015
+ }
2016
+ if (ch === '"') {
2017
+ quote = quote === 1 ? 0 : 1;
2018
+ continue;
2019
+ }
2020
+ if (quote === 1) {
2021
+ continue;
2022
+ }
2023
+ if (ch === "[") {
2024
+ bracket++;
2025
+ continue;
2026
+ }
2027
+ if (ch === "]" && bracket > 0) {
2028
+ bracket--;
2029
+ continue;
2030
+ }
2031
+ if (bracket > 0) {
2032
+ continue;
2033
+ }
2034
+ if (ch === "(") {
2035
+ paren++;
2036
+ continue;
2037
+ }
2038
+ if (ch === ")") {
2039
+ paren--;
2040
+ if (paren === 0) {
2041
+ if (requireEnd === true && i !== pattern.length - 1) {
2042
+ return;
2043
+ }
2044
+ return {
2045
+ type: pattern[0],
2046
+ body: pattern.slice(2, i),
2047
+ end: i
2048
+ };
2049
+ }
2050
+ }
2051
+ }
2052
+ }, "parseRepeatedExtglob");
2053
+ var getStarExtglobSequenceOutput = /* @__PURE__ */ __name((pattern) => {
2054
+ let index = 0;
2055
+ const chars = [];
2056
+ while (index < pattern.length) {
2057
+ const match = parseRepeatedExtglob(pattern.slice(index), false);
2058
+ if (!match || match.type !== "*") {
2059
+ return;
2060
+ }
2061
+ const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
2062
+ if (branches.length !== 1) {
2063
+ return;
2064
+ }
2065
+ const branch = normalizeSimpleBranch(branches[0]);
2066
+ if (!branch || branch.length !== 1) {
2067
+ return;
2068
+ }
2069
+ chars.push(branch);
2070
+ index += match.end + 1;
2071
+ }
2072
+ if (chars.length < 1) {
2073
+ return;
2074
+ }
2075
+ const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
2076
+ return `${source}*`;
2077
+ }, "getStarExtglobSequenceOutput");
2078
+ var repeatedExtglobRecursion = /* @__PURE__ */ __name((pattern) => {
2079
+ let depth = 0;
2080
+ let value = pattern.trim();
2081
+ let match = parseRepeatedExtglob(value);
2082
+ while (match) {
2083
+ depth++;
2084
+ value = match.body.trim();
2085
+ match = parseRepeatedExtglob(value);
2086
+ }
2087
+ return depth;
2088
+ }, "repeatedExtglobRecursion");
2089
+ var analyzeRepeatedExtglob = /* @__PURE__ */ __name((body, options) => {
2090
+ if (options.maxExtglobRecursion === false) {
2091
+ return {
2092
+ risky: false
2093
+ };
2094
+ }
2095
+ const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
2096
+ const branches = splitTopLevel(body).map((branch) => branch.trim());
2097
+ if (branches.length > 1) {
2098
+ if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
2099
+ return {
2100
+ risky: true
2101
+ };
2102
+ }
2103
+ }
2104
+ for (const branch of branches) {
2105
+ const safeOutput = getStarExtglobSequenceOutput(branch);
2106
+ if (safeOutput) {
2107
+ return {
2108
+ risky: true,
2109
+ safeOutput
2110
+ };
2111
+ }
2112
+ if (repeatedExtglobRecursion(branch) > max) {
2113
+ return {
2114
+ risky: true
2115
+ };
2116
+ }
2117
+ }
2118
+ return {
2119
+ risky: false
2120
+ };
2121
+ }, "analyzeRepeatedExtglob");
1900
2122
  var parse = /* @__PURE__ */ __name((input, options) => {
1901
2123
  if (typeof input !== "string") {
1902
2124
  throw new TypeError("Expected a string");
@@ -2027,6 +2249,8 @@ var require_parse2 = __commonJS({
2027
2249
  token.prev = prev;
2028
2250
  token.parens = state.parens;
2029
2251
  token.output = state.output;
2252
+ token.startIndex = state.index;
2253
+ token.tokensIndex = tokens.length;
2030
2254
  const output = (opts.capture ? "(" : "") + token.open;
2031
2255
  increment("parens");
2032
2256
  push({
@@ -2043,6 +2267,31 @@ var require_parse2 = __commonJS({
2043
2267
  extglobs.push(token);
2044
2268
  }, "extglobOpen");
2045
2269
  const extglobClose = /* @__PURE__ */ __name((token) => {
2270
+ const literal = input.slice(token.startIndex, state.index + 1);
2271
+ const body = input.slice(token.startIndex + 2, state.index);
2272
+ const analysis = analyzeRepeatedExtglob(body, opts);
2273
+ if ((token.type === "plus" || token.type === "star") && analysis.risky) {
2274
+ const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
2275
+ const open = tokens[token.tokensIndex];
2276
+ open.type = "text";
2277
+ open.value = literal;
2278
+ open.output = safeOutput || utils.escapeRegex(literal);
2279
+ for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
2280
+ tokens[i].value = "";
2281
+ tokens[i].output = "";
2282
+ delete tokens[i].suffix;
2283
+ }
2284
+ state.output = token.output + open.output;
2285
+ state.backtrack = true;
2286
+ push({
2287
+ type: "paren",
2288
+ extglob: true,
2289
+ value,
2290
+ output: ""
2291
+ });
2292
+ decrement("parens");
2293
+ return;
2294
+ }
2046
2295
  let output = token.close + (opts.capture ? ")" : "");
2047
2296
  let rest;
2048
2297
  if (token.type === "negate") {
@@ -2769,9 +3018,9 @@ var require_parse2 = __commonJS({
2769
3018
  }
2770
3019
  });
2771
3020
 
2772
- // ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js
3021
+ // ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js
2773
3022
  var require_picomatch = __commonJS({
2774
- "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js"(exports$1, module) {
3023
+ "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js"(exports$1, module) {
2775
3024
  init_esm_shims();
2776
3025
  var path = __require("path");
2777
3026
  var scan = require_scan();
@@ -2940,9 +3189,9 @@ var require_picomatch = __commonJS({
2940
3189
  }
2941
3190
  });
2942
3191
 
2943
- // ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.js
3192
+ // ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/index.js
2944
3193
  var require_picomatch2 = __commonJS({
2945
- "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.js"(exports$1, module) {
3194
+ "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/index.js"(exports$1, module) {
2946
3195
  init_esm_shims();
2947
3196
  module.exports = require_picomatch();
2948
3197
  }
@@ -1,4 +1,4 @@
1
- import { init_esm_shims, __name, Resolver, getConfigResolver, debug, __require, reflectionModeMatcher, debug2 } from './chunk-BXVCQBYB.js';
1
+ import { init_esm_shims, __name, Resolver, getConfigResolver, debug, __require, reflectionModeMatcher, debug2 } from './chunk-BZHCHSI3.js';
2
2
  import ts3, { isBigIntLiteral } from 'typescript';
3
3
 
4
4
  // ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=2011488ea7d6bd63266ba61c0f89d16f9db840d58a9ba80_0d4eeae2a917a1ea6c3b27e85fb3ee42/node_modules/@deepkit/type-compiler/dist/esm/src/compiler.js