cdk8s-plus-33 2.4.25 → 2.4.26

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.
Files changed (87) hide show
  1. package/.jsii +4 -4
  2. package/lib/api-resource.js +2 -2
  3. package/lib/base.js +2 -2
  4. package/lib/config-map.js +1 -1
  5. package/lib/container.js +6 -6
  6. package/lib/cron-job.js +1 -1
  7. package/lib/daemon-set.js +1 -1
  8. package/lib/deployment.js +3 -3
  9. package/lib/handler.js +1 -1
  10. package/lib/horizontal-pod-autoscaler.js +4 -4
  11. package/lib/imports/k8s.js +173 -173
  12. package/lib/ingress.js +2 -2
  13. package/lib/job.js +1 -1
  14. package/lib/namespace.js +2 -2
  15. package/lib/network-policy.js +3 -3
  16. package/lib/pod.js +16 -16
  17. package/lib/probe.js +1 -1
  18. package/lib/pv.js +4 -4
  19. package/lib/pvc.js +1 -1
  20. package/lib/role-binding.js +4 -4
  21. package/lib/role.js +2 -2
  22. package/lib/secret.js +6 -6
  23. package/lib/service-account.js +1 -1
  24. package/lib/service.js +1 -1
  25. package/lib/stateful-set.js +2 -2
  26. package/lib/volume.js +1 -1
  27. package/lib/workload.js +2 -2
  28. package/node_modules/brace-expansion/LICENSE +3 -1
  29. package/node_modules/brace-expansion/README.md +21 -62
  30. package/node_modules/brace-expansion/dist/commonjs/index.d.ts +6 -0
  31. package/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +1 -0
  32. package/node_modules/brace-expansion/dist/commonjs/index.js +199 -0
  33. package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -0
  34. package/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
  35. package/node_modules/brace-expansion/dist/esm/index.d.ts +6 -0
  36. package/node_modules/brace-expansion/dist/esm/index.d.ts.map +1 -0
  37. package/node_modules/brace-expansion/dist/esm/index.js +195 -0
  38. package/node_modules/brace-expansion/dist/esm/index.js.map +1 -0
  39. package/node_modules/brace-expansion/dist/esm/package.json +3 -0
  40. package/node_modules/{balanced-match → brace-expansion/node_modules/balanced-match}/LICENSE.md +3 -1
  41. package/node_modules/brace-expansion/node_modules/balanced-match/README.md +57 -0
  42. package/node_modules/brace-expansion/node_modules/balanced-match/dist/commonjs/index.d.ts +9 -0
  43. package/node_modules/brace-expansion/node_modules/balanced-match/dist/commonjs/index.d.ts.map +1 -0
  44. package/node_modules/brace-expansion/node_modules/balanced-match/dist/commonjs/index.js +59 -0
  45. package/node_modules/brace-expansion/node_modules/balanced-match/dist/commonjs/index.js.map +1 -0
  46. package/node_modules/brace-expansion/node_modules/balanced-match/dist/commonjs/package.json +3 -0
  47. package/node_modules/brace-expansion/node_modules/balanced-match/dist/esm/index.d.ts +9 -0
  48. package/node_modules/brace-expansion/node_modules/balanced-match/dist/esm/index.d.ts.map +1 -0
  49. package/node_modules/brace-expansion/node_modules/balanced-match/dist/esm/index.js +54 -0
  50. package/node_modules/brace-expansion/node_modules/balanced-match/dist/esm/index.js.map +1 -0
  51. package/node_modules/brace-expansion/node_modules/balanced-match/dist/esm/package.json +3 -0
  52. package/node_modules/brace-expansion/node_modules/balanced-match/package.json +68 -0
  53. package/node_modules/brace-expansion/package.json +51 -36
  54. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -1
  55. package/node_modules/minimatch/dist/commonjs/ast.d.ts.map +1 -1
  56. package/node_modules/minimatch/dist/commonjs/ast.js +11 -4
  57. package/node_modules/minimatch/dist/commonjs/ast.js.map +1 -1
  58. package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +1 -1
  59. package/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +1 -1
  60. package/node_modules/minimatch/dist/commonjs/escape.d.ts +1 -1
  61. package/node_modules/minimatch/dist/commonjs/escape.d.ts.map +1 -1
  62. package/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -1
  63. package/node_modules/minimatch/dist/commonjs/index.js +2 -5
  64. package/node_modules/minimatch/dist/commonjs/index.js.map +1 -1
  65. package/node_modules/minimatch/dist/commonjs/unescape.d.ts +1 -1
  66. package/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +1 -1
  67. package/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -1
  68. package/node_modules/minimatch/dist/esm/ast.d.ts.map +1 -1
  69. package/node_modules/minimatch/dist/esm/ast.js +11 -4
  70. package/node_modules/minimatch/dist/esm/ast.js.map +1 -1
  71. package/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +1 -1
  72. package/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -1
  73. package/node_modules/minimatch/dist/esm/escape.d.ts +1 -1
  74. package/node_modules/minimatch/dist/esm/escape.d.ts.map +1 -1
  75. package/node_modules/minimatch/dist/esm/index.d.ts.map +1 -1
  76. package/node_modules/minimatch/dist/esm/index.js +1 -1
  77. package/node_modules/minimatch/dist/esm/index.js.map +1 -1
  78. package/node_modules/minimatch/dist/esm/unescape.d.ts +1 -1
  79. package/node_modules/minimatch/dist/esm/unescape.d.ts.map +1 -1
  80. package/node_modules/minimatch/package.json +13 -14
  81. package/package.json +7 -7
  82. package/node_modules/balanced-match/.github/FUNDING.yml +0 -2
  83. package/node_modules/balanced-match/README.md +0 -97
  84. package/node_modules/balanced-match/index.js +0 -62
  85. package/node_modules/balanced-match/package.json +0 -48
  86. package/node_modules/brace-expansion/.github/FUNDING.yml +0 -2
  87. package/node_modules/brace-expansion/index.js +0 -203
@@ -0,0 +1,57 @@
1
+ # balanced-match
2
+
3
+ Match balanced string pairs, like `{` and `}` or `<b>` and
4
+ `</b>`. Supports regular expressions as well!
5
+
6
+ ## Example
7
+
8
+ Get the first matching pair of braces:
9
+
10
+ ```js
11
+ import { balanced } from 'balanced-match'
12
+
13
+ console.log(balanced('{', '}', 'pre{in{nested}}post'))
14
+ console.log(balanced('{', '}', 'pre{first}between{second}post'))
15
+ console.log(
16
+ balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post'),
17
+ )
18
+ ```
19
+
20
+ The matches are:
21
+
22
+ ```bash
23
+ $ node example.js
24
+ { start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
25
+ { start: 3,
26
+ end: 9,
27
+ pre: 'pre',
28
+ body: 'first',
29
+ post: 'between{second}post' }
30
+ { start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
31
+ ```
32
+
33
+ ## API
34
+
35
+ ### const m = balanced(a, b, str)
36
+
37
+ For the first non-nested matching pair of `a` and `b` in `str`, return an
38
+ object with those keys:
39
+
40
+ - **start** the index of the first match of `a`
41
+ - **end** the index of the matching `b`
42
+ - **pre** the preamble, `a` and `b` not included
43
+ - **body** the match, `a` and `b` not included
44
+ - **post** the postscript, `a` and `b` not included
45
+
46
+ If there's no match, `undefined` will be returned.
47
+
48
+ If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.
49
+
50
+ ### const r = balanced.range(a, b, str)
51
+
52
+ For the first non-nested matching pair of `a` and `b` in `str`, return an
53
+ array with indexes: `[ <a index>, <b index> ]`.
54
+
55
+ If there's no match, `undefined` will be returned.
56
+
57
+ If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.
@@ -0,0 +1,9 @@
1
+ export declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | {
2
+ start: number;
3
+ end: number;
4
+ pre: string;
5
+ body: string;
6
+ post: string;
7
+ } | undefined;
8
+ export declare const range: (a: string, b: string, str: string) => undefined | [number, number];
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.range = exports.balanced = void 0;
4
+ const balanced = (a, b, str) => {
5
+ const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
6
+ const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
7
+ const r = ma !== null && mb != null && (0, exports.range)(ma, mb, str);
8
+ return (r && {
9
+ start: r[0],
10
+ end: r[1],
11
+ pre: str.slice(0, r[0]),
12
+ body: str.slice(r[0] + ma.length, r[1]),
13
+ post: str.slice(r[1] + mb.length),
14
+ });
15
+ };
16
+ exports.balanced = balanced;
17
+ const maybeMatch = (reg, str) => {
18
+ const m = str.match(reg);
19
+ return m ? m[0] : null;
20
+ };
21
+ const range = (a, b, str) => {
22
+ let begs, beg, left, right = undefined, result;
23
+ let ai = str.indexOf(a);
24
+ let bi = str.indexOf(b, ai + 1);
25
+ let i = ai;
26
+ if (ai >= 0 && bi > 0) {
27
+ if (a === b) {
28
+ return [ai, bi];
29
+ }
30
+ begs = [];
31
+ left = str.length;
32
+ while (i >= 0 && !result) {
33
+ if (i === ai) {
34
+ begs.push(i);
35
+ ai = str.indexOf(a, i + 1);
36
+ }
37
+ else if (begs.length === 1) {
38
+ const r = begs.pop();
39
+ if (r !== undefined)
40
+ result = [r, bi];
41
+ }
42
+ else {
43
+ beg = begs.pop();
44
+ if (beg !== undefined && beg < left) {
45
+ left = beg;
46
+ right = bi;
47
+ }
48
+ bi = str.indexOf(b, i + 1);
49
+ }
50
+ i = ai < bi && ai >= 0 ? ai : bi;
51
+ }
52
+ if (begs.length && right !== undefined) {
53
+ result = [left, right];
54
+ }
55
+ }
56
+ return result;
57
+ };
58
+ exports.range = range;
59
+ //# sourceMappingURL=index.js.map
@@ -0,0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KAAK,GAAG,EAAE,CAAA;gBACZ,CAAC;gBAED,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC5B,CAAC;YAED,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AA/CY,QAAA,KAAK,SA+CjB","sourcesContent":["export const balanced = (\n a: string | RegExp,\n b: string | RegExp,\n str: string,\n) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]}
@@ -0,0 +1,9 @@
1
+ export declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | {
2
+ start: number;
3
+ end: number;
4
+ pre: string;
5
+ body: string;
6
+ post: string;
7
+ } | undefined;
8
+ export declare const range: (a: string, b: string, str: string) => undefined | [number, number];
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"}
@@ -0,0 +1,54 @@
1
+ export const balanced = (a, b, str) => {
2
+ const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
3
+ const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
4
+ const r = ma !== null && mb != null && range(ma, mb, str);
5
+ return (r && {
6
+ start: r[0],
7
+ end: r[1],
8
+ pre: str.slice(0, r[0]),
9
+ body: str.slice(r[0] + ma.length, r[1]),
10
+ post: str.slice(r[1] + mb.length),
11
+ });
12
+ };
13
+ const maybeMatch = (reg, str) => {
14
+ const m = str.match(reg);
15
+ return m ? m[0] : null;
16
+ };
17
+ export const range = (a, b, str) => {
18
+ let begs, beg, left, right = undefined, result;
19
+ let ai = str.indexOf(a);
20
+ let bi = str.indexOf(b, ai + 1);
21
+ let i = ai;
22
+ if (ai >= 0 && bi > 0) {
23
+ if (a === b) {
24
+ return [ai, bi];
25
+ }
26
+ begs = [];
27
+ left = str.length;
28
+ while (i >= 0 && !result) {
29
+ if (i === ai) {
30
+ begs.push(i);
31
+ ai = str.indexOf(a, i + 1);
32
+ }
33
+ else if (begs.length === 1) {
34
+ const r = begs.pop();
35
+ if (r !== undefined)
36
+ result = [r, bi];
37
+ }
38
+ else {
39
+ beg = begs.pop();
40
+ if (beg !== undefined && beg < left) {
41
+ left = beg;
42
+ right = bi;
43
+ }
44
+ bi = str.indexOf(b, i + 1);
45
+ }
46
+ i = ai < bi && ai >= 0 ? ai : bi;
47
+ }
48
+ if (begs.length && right !== undefined) {
49
+ result = [left, right];
50
+ }
51
+ }
52
+ return result;
53
+ };
54
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAkB,EAClB,CAAkB,EAClB,GAAW,EACX,EAAE;IACF,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEvD,MAAM,CAAC,GAAG,EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;IAEzD,OAAO,CACL,CAAC,IAAI;QACH,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;QACX,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACT,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,C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AAC,CAAC,CAAA;YAC5B,CAAC;iBAAM,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBACpB,IAAI,CAAC,KAAK,SAAS;oBAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;YACvC,CAAC;iBAAM,CAAC;gBACN,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBAChB,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;oBACpC,IAAI,GAAG,GAAG,CAAA;oBACV,KAAK,GAAG,EAAE,CAAA;gBACZ,CAAC;gBAED,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC5B,CAAC;YAED,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA","sourcesContent":["export const balanced = (\n a: string | RegExp,\n b: string | RegExp,\n str: string,\n) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]}
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "balanced-match",
3
+ "description": "Match balanced character pairs, like \"{\" and \"}\"",
4
+ "version": "4.0.3",
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git://github.com/juliangruber/balanced-match.git"
11
+ },
12
+ "exports": {
13
+ "./package.json": "./package.json",
14
+ ".": {
15
+ "import": {
16
+ "types": "./dist/esm/index.d.ts",
17
+ "default": "./dist/esm/index.js"
18
+ },
19
+ "require": {
20
+ "types": "./dist/commonjs/index.d.ts",
21
+ "default": "./dist/commonjs/index.js"
22
+ }
23
+ }
24
+ },
25
+ "type": "module",
26
+ "scripts": {
27
+ "preversion": "npm test",
28
+ "postversion": "npm publish",
29
+ "prepublishOnly": "git push origin --follow-tags",
30
+ "prepare": "tshy",
31
+ "pretest": "npm run prepare",
32
+ "presnap": "npm run prepare",
33
+ "test": "tap",
34
+ "snap": "tap",
35
+ "format": "prettier --write .",
36
+ "benchmark": "node benchmark/index.js",
37
+ "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
38
+ },
39
+ "devDependencies": {
40
+ "@types/brace-expansion": "^1.1.2",
41
+ "@types/node": "^25.2.1",
42
+ "mkdirp": "^3.0.1",
43
+ "prettier": "^3.3.2",
44
+ "tap": "^21.1.0",
45
+ "tshy": "^3.0.2",
46
+ "typedoc": "^0.28.5"
47
+ },
48
+ "keywords": [
49
+ "match",
50
+ "regexp",
51
+ "test",
52
+ "balanced",
53
+ "parse"
54
+ ],
55
+ "license": "MIT",
56
+ "engines": {
57
+ "node": "20 || >=22"
58
+ },
59
+ "tshy": {
60
+ "exports": {
61
+ "./package.json": "./package.json",
62
+ ".": "./src/index.ts"
63
+ }
64
+ },
65
+ "main": "./dist/commonjs/index.js",
66
+ "types": "./dist/commonjs/index.d.ts",
67
+ "module": "./dist/esm/index.js"
68
+ }
@@ -1,49 +1,64 @@
1
1
  {
2
2
  "name": "brace-expansion",
3
3
  "description": "Brace expansion as known from sh/bash",
4
- "version": "2.0.2",
5
- "repository": {
6
- "type": "git",
7
- "url": "git://github.com/juliangruber/brace-expansion.git"
4
+ "version": "5.0.2",
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "exports": {
9
+ "./package.json": "./package.json",
10
+ ".": {
11
+ "import": {
12
+ "types": "./dist/esm/index.d.ts",
13
+ "default": "./dist/esm/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/commonjs/index.d.ts",
17
+ "default": "./dist/commonjs/index.js"
18
+ }
19
+ }
8
20
  },
9
- "homepage": "https://github.com/juliangruber/brace-expansion",
10
- "main": "index.js",
21
+ "type": "module",
11
22
  "scripts": {
12
- "test": "tape test/*.js",
13
- "gentest": "bash test/generate.sh",
14
- "bench": "matcha test/perf/bench.js"
15
- },
16
- "dependencies": {
17
- "balanced-match": "^1.0.0"
23
+ "preversion": "npm test",
24
+ "postversion": "npm publish",
25
+ "prepublishOnly": "git push origin --follow-tags",
26
+ "prepare": "tshy",
27
+ "pretest": "npm run prepare",
28
+ "presnap": "npm run prepare",
29
+ "test": "tap",
30
+ "snap": "tap",
31
+ "format": "prettier --write .",
32
+ "benchmark": "node benchmark/index.js",
33
+ "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
18
34
  },
19
35
  "devDependencies": {
20
- "@c4312/matcha": "^1.3.1",
21
- "tape": "^4.6.0"
36
+ "@types/brace-expansion": "^1.1.2",
37
+ "@types/node": "^25.2.1",
38
+ "mkdirp": "^3.0.1",
39
+ "prettier": "^3.3.2",
40
+ "tap": "^21.5.0",
41
+ "tshy": "^3.0.2",
42
+ "typedoc": "^0.28.5"
22
43
  },
23
- "keywords": [],
24
- "author": {
25
- "name": "Julian Gruber",
26
- "email": "mail@juliangruber.com",
27
- "url": "http://juliangruber.com"
44
+ "dependencies": {
45
+ "balanced-match": "^4.0.2"
28
46
  },
29
47
  "license": "MIT",
30
- "testling": {
31
- "files": "test/*.js",
32
- "browsers": [
33
- "ie/8..latest",
34
- "firefox/20..latest",
35
- "firefox/nightly",
36
- "chrome/25..latest",
37
- "chrome/canary",
38
- "opera/12..latest",
39
- "opera/next",
40
- "safari/5.1..latest",
41
- "ipad/6.0..latest",
42
- "iphone/6.0..latest",
43
- "android-browser/4.2..latest"
44
- ]
48
+ "engines": {
49
+ "node": "20 || >=22"
50
+ },
51
+ "tshy": {
52
+ "exports": {
53
+ "./package.json": "./package.json",
54
+ ".": "./src/index.ts"
55
+ }
45
56
  },
46
- "publishConfig": {
47
- "tag": "2.x"
57
+ "main": "./dist/commonjs/index.js",
58
+ "types": "./dist/commonjs/index.d.ts",
59
+ "module": "./dist/esm/index.js",
60
+ "repository": {
61
+ "type": "git",
62
+ "url": "git+ssh://git@github.com/juliangruber/brace-expansion.git"
48
63
  }
49
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":";;;AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AAC7B,MAAM,kBAAkB,GAA2B,CACxD,OAAY,EACe,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;KACvC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE;QACvC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;KAC3C;AACH,CAAC,CAAA;AAVY,QAAA,kBAAkB,sBAU9B","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: any) => void = (\n pattern: any\n): asserts pattern is string => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n"]}
1
+ {"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":";;;AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AAC7B,MAAM,kBAAkB,GAA2B,CACxD,OAAY,EACe,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;IACxC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA;AAVY,QAAA,kBAAkB,sBAU9B","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: any) => void = (\n pattern: any\n): asserts pattern is string => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CA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OAAO,GAAE,gBAAqB;IAahC,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAUlC;IAGD,QAAQ,IAAI,MAAM;IA+ClB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAY/B,MAAM;IAgBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsIjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,CACZ,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;CAwMjE"}
@@ -544,11 +544,14 @@ class AST {
544
544
  let escaping = false;
545
545
  let re = '';
546
546
  let uflag = false;
547
+ // multiple stars that aren't globstars coalesce into one *
548
+ let inStar = false;
547
549
  for (let i = 0; i < glob.length; i++) {
548
550
  const c = glob.charAt(i);
549
551
  if (escaping) {
550
552
  escaping = false;
551
553
  re += (reSpecials.has(c) ? '\\' : '') + c;
554
+ inStar = false;
552
555
  continue;
553
556
  }
554
557
  if (c === '\\') {
@@ -567,17 +570,21 @@ class AST {
567
570
  uflag = uflag || needUflag;
568
571
  i += consumed - 1;
569
572
  hasMagic = hasMagic || magic;
573
+ inStar = false;
570
574
  continue;
571
575
  }
572
576
  }
573
577
  if (c === '*') {
574
- if (noEmpty && glob === '*')
575
- re += starNoEmpty;
576
- else
577
- re += star;
578
+ if (inStar)
579
+ continue;
580
+ inStar = true;
581
+ re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
578
582
  hasMagic = true;
579
583
  continue;
580
584
  }
585
+ else {
586
+ inStar = false;
587
+ }
581
588
  if (c === '?') {
582
589
  re += qmark;
583
590
  hasMagic = true;