@codingame/monaco-vscode-rollup-vsix-plugin 9.0.0 → 9.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-rollup-vsix-plugin",
3
- "version": "9.0.0",
3
+ "version": "9.0.2",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -1301,7 +1301,7 @@ var utils$j = {};
1301
1301
  */
1302
1302
 
1303
1303
  exports.escapeNode = (block, n = 0, type) => {
1304
- let node = block.nodes[n];
1304
+ const node = block.nodes[n];
1305
1305
  if (!node) return;
1306
1306
 
1307
1307
  if ((type && node.type === type) || node.type === 'open' || node.type === 'close') {
@@ -1370,13 +1370,23 @@ var utils$j = {};
1370
1370
 
1371
1371
  exports.flatten = (...args) => {
1372
1372
  const result = [];
1373
+
1373
1374
  const flat = arr => {
1374
1375
  for (let i = 0; i < arr.length; i++) {
1375
- let ele = arr[i];
1376
- Array.isArray(ele) ? flat(ele) : ele !== void 0 && result.push(ele);
1376
+ const ele = arr[i];
1377
+
1378
+ if (Array.isArray(ele)) {
1379
+ flat(ele);
1380
+ continue;
1381
+ }
1382
+
1383
+ if (ele !== undefined) {
1384
+ result.push(ele);
1385
+ }
1377
1386
  }
1378
1387
  return result;
1379
1388
  };
1389
+
1380
1390
  flat(args);
1381
1391
  return result;
1382
1392
  };
@@ -1385,9 +1395,9 @@ var utils$j = {};
1385
1395
  const utils$i = utils$j;
1386
1396
 
1387
1397
  var stringify$4 = (ast, options = {}) => {
1388
- let stringify = (node, parent = {}) => {
1389
- let invalidBlock = options.escapeInvalid && utils$i.isInvalidBrace(parent);
1390
- let invalidNode = node.invalid === true && options.escapeInvalid === true;
1398
+ const stringify = (node, parent = {}) => {
1399
+ const invalidBlock = options.escapeInvalid && utils$i.isInvalidBrace(parent);
1400
+ const invalidNode = node.invalid === true && options.escapeInvalid === true;
1391
1401
  let output = '';
1392
1402
 
1393
1403
  if (node.value) {
@@ -1402,7 +1412,7 @@ var stringify$4 = (ast, options = {}) => {
1402
1412
  }
1403
1413
 
1404
1414
  if (node.nodes) {
1405
- for (let child of node.nodes) {
1415
+ for (const child of node.nodes) {
1406
1416
  output += stringify(child);
1407
1417
  }
1408
1418
  }
@@ -1776,7 +1786,7 @@ const toMaxLen = (input, maxLength) => {
1776
1786
  return negative ? ('-' + input) : input;
1777
1787
  };
1778
1788
 
1779
- const toSequence = (parts, options) => {
1789
+ const toSequence = (parts, options, maxLen) => {
1780
1790
  parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
1781
1791
  parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
1782
1792
 
@@ -1786,11 +1796,11 @@ const toSequence = (parts, options) => {
1786
1796
  let result;
1787
1797
 
1788
1798
  if (parts.positives.length) {
1789
- positives = parts.positives.join('|');
1799
+ positives = parts.positives.map(v => toMaxLen(String(v), maxLen)).join('|');
1790
1800
  }
1791
1801
 
1792
1802
  if (parts.negatives.length) {
1793
- negatives = `-(${prefix}${parts.negatives.join('|')})`;
1803
+ negatives = `-(${prefix}${parts.negatives.map(v => toMaxLen(String(v), maxLen)).join('|')})`;
1794
1804
  }
1795
1805
 
1796
1806
  if (positives && negatives) {
@@ -1888,7 +1898,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
1888
1898
 
1889
1899
  if (options.toRegex === true) {
1890
1900
  return step > 1
1891
- ? toSequence(parts, options)
1901
+ ? toSequence(parts, options, maxLen)
1892
1902
  : toRegex(range, null, { wrap: false, ...options });
1893
1903
  }
1894
1904
 
@@ -1900,7 +1910,6 @@ const fillLetters = (start, end, step = 1, options = {}) => {
1900
1910
  return invalidRange(start, end, options);
1901
1911
  }
1902
1912
 
1903
-
1904
1913
  let format = options.transform || (val => String.fromCharCode(val));
1905
1914
  let a = `${start}`.charCodeAt(0);
1906
1915
  let b = `${end}`.charCodeAt(0);
@@ -1968,30 +1977,32 @@ const fill$1 = fillRange;
1968
1977
  const utils$h = utils$j;
1969
1978
 
1970
1979
  const compile$1 = (ast, options = {}) => {
1971
- let walk = (node, parent = {}) => {
1972
- let invalidBlock = utils$h.isInvalidBrace(parent);
1973
- let invalidNode = node.invalid === true && options.escapeInvalid === true;
1974
- let invalid = invalidBlock === true || invalidNode === true;
1975
- let prefix = options.escapeInvalid === true ? '\\' : '';
1980
+ const walk = (node, parent = {}) => {
1981
+ const invalidBlock = utils$h.isInvalidBrace(parent);
1982
+ const invalidNode = node.invalid === true && options.escapeInvalid === true;
1983
+ const invalid = invalidBlock === true || invalidNode === true;
1984
+ const prefix = options.escapeInvalid === true ? '\\' : '';
1976
1985
  let output = '';
1977
1986
 
1978
1987
  if (node.isOpen === true) {
1979
1988
  return prefix + node.value;
1980
1989
  }
1990
+
1981
1991
  if (node.isClose === true) {
1992
+ console.log('node.isClose', prefix, node.value);
1982
1993
  return prefix + node.value;
1983
1994
  }
1984
1995
 
1985
1996
  if (node.type === 'open') {
1986
- return invalid ? (prefix + node.value) : '(';
1997
+ return invalid ? prefix + node.value : '(';
1987
1998
  }
1988
1999
 
1989
2000
  if (node.type === 'close') {
1990
- return invalid ? (prefix + node.value) : ')';
2001
+ return invalid ? prefix + node.value : ')';
1991
2002
  }
1992
2003
 
1993
2004
  if (node.type === 'comma') {
1994
- return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|');
2005
+ return node.prev.type === 'comma' ? '' : invalid ? node.value : '|';
1995
2006
  }
1996
2007
 
1997
2008
  if (node.value) {
@@ -1999,8 +2010,8 @@ const compile$1 = (ast, options = {}) => {
1999
2010
  }
2000
2011
 
2001
2012
  if (node.nodes && node.ranges > 0) {
2002
- let args = utils$h.reduce(node.nodes);
2003
- let range = fill$1(...args, { ...options, wrap: false, toRegex: true });
2013
+ const args = utils$h.reduce(node.nodes);
2014
+ const range = fill$1(...args, { ...options, wrap: false, toRegex: true, strictZeros: true });
2004
2015
 
2005
2016
  if (range.length !== 0) {
2006
2017
  return args.length > 1 && range.length > 1 ? `(${range})` : range;
@@ -2008,10 +2019,11 @@ const compile$1 = (ast, options = {}) => {
2008
2019
  }
2009
2020
 
2010
2021
  if (node.nodes) {
2011
- for (let child of node.nodes) {
2022
+ for (const child of node.nodes) {
2012
2023
  output += walk(child, node);
2013
2024
  }
2014
2025
  }
2026
+
2015
2027
  return output;
2016
2028
  };
2017
2029
 
@@ -2025,7 +2037,7 @@ const stringify$2 = stringify$4;
2025
2037
  const utils$g = utils$j;
2026
2038
 
2027
2039
  const append = (queue = '', stash = '', enclose = false) => {
2028
- let result = [];
2040
+ const result = [];
2029
2041
 
2030
2042
  queue = [].concat(queue);
2031
2043
  stash = [].concat(stash);
@@ -2035,15 +2047,15 @@ const append = (queue = '', stash = '', enclose = false) => {
2035
2047
  return enclose ? utils$g.flatten(stash).map(ele => `{${ele}}`) : stash;
2036
2048
  }
2037
2049
 
2038
- for (let item of queue) {
2050
+ for (const item of queue) {
2039
2051
  if (Array.isArray(item)) {
2040
- for (let value of item) {
2052
+ for (const value of item) {
2041
2053
  result.push(append(value, stash, enclose));
2042
2054
  }
2043
2055
  } else {
2044
2056
  for (let ele of stash) {
2045
2057
  if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
2046
- result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele));
2058
+ result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
2047
2059
  }
2048
2060
  }
2049
2061
  }
@@ -2051,9 +2063,9 @@ const append = (queue = '', stash = '', enclose = false) => {
2051
2063
  };
2052
2064
 
2053
2065
  const expand$1 = (ast, options = {}) => {
2054
- let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit;
2066
+ const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit;
2055
2067
 
2056
- let walk = (node, parent = {}) => {
2068
+ const walk = (node, parent = {}) => {
2057
2069
  node.queue = [];
2058
2070
 
2059
2071
  let p = parent;
@@ -2075,7 +2087,7 @@ const expand$1 = (ast, options = {}) => {
2075
2087
  }
2076
2088
 
2077
2089
  if (node.nodes && node.ranges > 0) {
2078
- let args = utils$g.reduce(node.nodes);
2090
+ const args = utils$g.reduce(node.nodes);
2079
2091
 
2080
2092
  if (utils$g.exceedsLimit(...args, options.step, rangeLimit)) {
2081
2093
  throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
@@ -2091,7 +2103,7 @@ const expand$1 = (ast, options = {}) => {
2091
2103
  return;
2092
2104
  }
2093
2105
 
2094
- let enclose = utils$g.encloseBrace(node);
2106
+ const enclose = utils$g.encloseBrace(node);
2095
2107
  let queue = node.queue;
2096
2108
  let block = node;
2097
2109
 
@@ -2101,7 +2113,7 @@ const expand$1 = (ast, options = {}) => {
2101
2113
  }
2102
2114
 
2103
2115
  for (let i = 0; i < node.nodes.length; i++) {
2104
- let child = node.nodes[i];
2116
+ const child = node.nodes[i];
2105
2117
 
2106
2118
  if (child.type === 'comma' && node.type === 'brace') {
2107
2119
  if (i === 1) queue.push('');
@@ -2133,7 +2145,7 @@ const expand$1 = (ast, options = {}) => {
2133
2145
  var expand_1 = expand$1;
2134
2146
 
2135
2147
  var constants$4 = {
2136
- MAX_LENGTH: 1024 * 64,
2148
+ MAX_LENGTH: 10000,
2137
2149
 
2138
2150
  // Digits
2139
2151
  CHAR_0: '0', /* 0 */
@@ -2221,18 +2233,18 @@ const parse$3 = (input, options = {}) => {
2221
2233
  throw new TypeError('Expected a string');
2222
2234
  }
2223
2235
 
2224
- let opts = options || {};
2225
- let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1;
2236
+ const opts = options || {};
2237
+ const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1;
2226
2238
  if (input.length > max) {
2227
2239
  throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
2228
2240
  }
2229
2241
 
2230
- let ast = { type: 'root', input, nodes: [] };
2231
- let stack = [ast];
2242
+ const ast = { type: 'root', input, nodes: [] };
2243
+ const stack = [ast];
2232
2244
  let block = ast;
2233
2245
  let prev = ast;
2234
2246
  let brackets = 0;
2235
- let length = input.length;
2247
+ const length = input.length;
2236
2248
  let index = 0;
2237
2249
  let depth = 0;
2238
2250
  let value;
@@ -2297,6 +2309,7 @@ const parse$3 = (input, options = {}) => {
2297
2309
 
2298
2310
  if (value === CHAR_LEFT_SQUARE_BRACKET$1) {
2299
2311
  brackets++;
2312
+
2300
2313
  let next;
2301
2314
 
2302
2315
  while (index < length && (next = advance())) {
@@ -2352,7 +2365,7 @@ const parse$3 = (input, options = {}) => {
2352
2365
  */
2353
2366
 
2354
2367
  if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
2355
- let open = value;
2368
+ const open = value;
2356
2369
  let next;
2357
2370
 
2358
2371
  if (options.keepQuotes !== true) {
@@ -2384,8 +2397,8 @@ const parse$3 = (input, options = {}) => {
2384
2397
  if (value === CHAR_LEFT_CURLY_BRACE$1) {
2385
2398
  depth++;
2386
2399
 
2387
- let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
2388
- let brace = {
2400
+ const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
2401
+ const brace = {
2389
2402
  type: 'brace',
2390
2403
  open: true,
2391
2404
  close: false,
@@ -2412,7 +2425,7 @@ const parse$3 = (input, options = {}) => {
2412
2425
  continue;
2413
2426
  }
2414
2427
 
2415
- let type = 'close';
2428
+ const type = 'close';
2416
2429
  block = stack.pop();
2417
2430
  block.close = true;
2418
2431
 
@@ -2430,7 +2443,7 @@ const parse$3 = (input, options = {}) => {
2430
2443
  if (value === CHAR_COMMA$1 && depth > 0) {
2431
2444
  if (block.ranges > 0) {
2432
2445
  block.ranges = 0;
2433
- let open = block.nodes.shift();
2446
+ const open = block.nodes.shift();
2434
2447
  block.nodes = [open, { type: 'text', value: stringify$1(block) }];
2435
2448
  }
2436
2449
 
@@ -2444,7 +2457,7 @@ const parse$3 = (input, options = {}) => {
2444
2457
  */
2445
2458
 
2446
2459
  if (value === CHAR_DOT$1 && depth > 0 && block.commas === 0) {
2447
- let siblings = block.nodes;
2460
+ const siblings = block.nodes;
2448
2461
 
2449
2462
  if (depth === 0 || siblings.length === 0) {
2450
2463
  push({ type: 'text', value });
@@ -2471,7 +2484,7 @@ const parse$3 = (input, options = {}) => {
2471
2484
  if (prev.type === 'range') {
2472
2485
  siblings.pop();
2473
2486
 
2474
- let before = siblings[siblings.length - 1];
2487
+ const before = siblings[siblings.length - 1];
2475
2488
  before.value += prev.value + value;
2476
2489
  prev = before;
2477
2490
  block.ranges--;
@@ -2504,8 +2517,8 @@ const parse$3 = (input, options = {}) => {
2504
2517
  });
2505
2518
 
2506
2519
  // get the location of the block on parent.nodes (block's siblings)
2507
- let parent = stack[stack.length - 1];
2508
- let index = parent.nodes.indexOf(block);
2520
+ const parent = stack[stack.length - 1];
2521
+ const index = parent.nodes.indexOf(block);
2509
2522
  // replace the (invalid) block with it's nodes
2510
2523
  parent.nodes.splice(index, 1, ...block.nodes);
2511
2524
  }
@@ -2540,8 +2553,8 @@ const braces$1 = (input, options = {}) => {
2540
2553
  let output = [];
2541
2554
 
2542
2555
  if (Array.isArray(input)) {
2543
- for (let pattern of input) {
2544
- let result = braces$1.create(pattern, options);
2556
+ for (const pattern of input) {
2557
+ const result = braces$1.create(pattern, options);
2545
2558
  if (Array.isArray(result)) {
2546
2559
  output.push(...result);
2547
2560
  } else {
@@ -2675,7 +2688,7 @@ braces$1.create = (input, options = {}) => {
2675
2688
  return [input];
2676
2689
  }
2677
2690
 
2678
- return options.expand !== true
2691
+ return options.expand !== true
2679
2692
  ? braces$1.compile(input, options)
2680
2693
  : braces$1.expand(input, options);
2681
2694
  };
@@ -4759,7 +4772,12 @@ const util = require$$0$1;
4759
4772
  const braces = braces_1;
4760
4773
  const picomatch = picomatch$1;
4761
4774
  const utils$b = utils$f;
4762
- const isEmptyString = val => val === '' || val === './';
4775
+
4776
+ const isEmptyString = v => v === '' || v === './';
4777
+ const hasBraces = v => {
4778
+ const index = v.indexOf('{');
4779
+ return index > -1 && v.indexOf('}', index) > -1;
4780
+ };
4763
4781
 
4764
4782
  /**
4765
4783
  * Returns an array of strings that match one or more glob patterns.
@@ -5200,7 +5218,7 @@ micromatch$1.parse = (patterns, options) => {
5200
5218
 
5201
5219
  micromatch$1.braces = (pattern, options) => {
5202
5220
  if (typeof pattern !== 'string') throw new TypeError('Expected a string');
5203
- if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) {
5221
+ if ((options && options.nobrace === true) || !hasBraces(pattern)) {
5204
5222
  return [pattern];
5205
5223
  }
5206
5224
  return braces(pattern, options);
@@ -5219,6 +5237,8 @@ micromatch$1.braceExpand = (pattern, options) => {
5219
5237
  * Expose micromatch
5220
5238
  */
5221
5239
 
5240
+ // exposed for tests
5241
+ micromatch$1.hasBraces = hasBraces;
5222
5242
  var micromatch_1 = micromatch$1;
5223
5243
 
5224
5244
  Object.defineProperty(pattern$1, "__esModule", { value: true });