diff --git a/.licenses/npm/@oozcitak/dom.dep.yml b/.licenses/npm/@oozcitak/dom.dep.yml deleted file mode 100644 index ee5008c2..00000000 Binary files a/.licenses/npm/@oozcitak/dom.dep.yml and /dev/null differ diff --git a/.licenses/npm/@oozcitak/infra.dep.yml b/.licenses/npm/@oozcitak/infra.dep.yml deleted file mode 100644 index b347e00a..00000000 Binary files a/.licenses/npm/@oozcitak/infra.dep.yml and /dev/null differ diff --git a/.licenses/npm/@oozcitak/url.dep.yml b/.licenses/npm/@oozcitak/url.dep.yml deleted file mode 100644 index c7d7fb70..00000000 Binary files a/.licenses/npm/@oozcitak/url.dep.yml and /dev/null differ diff --git a/.licenses/npm/@oozcitak/util.dep.yml b/.licenses/npm/@oozcitak/util.dep.yml deleted file mode 100644 index 855116de..00000000 Binary files a/.licenses/npm/@oozcitak/util.dep.yml and /dev/null differ diff --git a/.licenses/npm/argparse.dep.yml b/.licenses/npm/argparse.dep.yml deleted file mode 100644 index 0eba425d..00000000 Binary files a/.licenses/npm/argparse.dep.yml and /dev/null differ diff --git a/.licenses/npm/brace-expansion.dep.yml b/.licenses/npm/brace-expansion.dep.yml index bc757a22..96e6211b 100644 Binary files a/.licenses/npm/brace-expansion.dep.yml and b/.licenses/npm/brace-expansion.dep.yml differ diff --git a/.licenses/npm/js-yaml.dep.yml b/.licenses/npm/js-yaml.dep.yml deleted file mode 100644 index 74134d2b..00000000 Binary files a/.licenses/npm/js-yaml.dep.yml and /dev/null differ diff --git a/.licenses/npm/xmlbuilder2.dep.yml b/.licenses/npm/xmlbuilder2.dep.yml deleted file mode 100644 index d85cad54..00000000 Binary files a/.licenses/npm/xmlbuilder2.dep.yml and /dev/null differ diff --git a/__tests__/java-package-contract.test.ts b/__tests__/java-package-contract.test.ts index ea320ef9..457b0a49 100644 --- a/__tests__/java-package-contract.test.ts +++ b/__tests__/java-package-contract.test.ts @@ -22,7 +22,7 @@ describe('java-package published contract', () => { ? content.match(/ {2}java-package:\n(?: {4}.+\n)+/)?.[0] : content .split('\n') - .find(line => line.includes('- `java-package`:')); + .find(line => line.includes('| `java-package` |')); expect(contractLine).toBeDefined(); for (const packageType of allPackageTypes) { diff --git a/dist/cleanup/767.index.js b/dist/cleanup/767.index.js index db75c2b3..b73e9e9f 100644 --- a/dist/cleanup/767.index.js +++ b/dist/cleanup/767.index.js @@ -59543,7 +59543,7 @@ function combine(acc, pre, values, max, maxLength, dropEmpties) { } // The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`) // sequence body. -function expandSequence(body, isAlphaSequence, max) { +function expandSequence(body, isAlphaSequence, max, maxLength) { const n = body.split(/\.\./); const N = []; // A sequence body always splits into two or three parts, but the compiler @@ -59566,6 +59566,7 @@ function expandSequence(body, isAlphaSequence, max) { test = gte; } const pad = n.some(isPadded); + let length = 0; for (let i = x; test(i, y) && N.length < max; i += incr) { let c; if (isAlphaSequence) { @@ -59589,7 +59590,10 @@ function expandSequence(body, isAlphaSequence, max) { } } } + if (length + c.length > maxLength) + break; N.push(c); + length += c.length; } return N; } @@ -59643,7 +59647,7 @@ function expand_(str, max, maxLength, isTop) { } let values; if (isSequence) { - values = expandSequence(m.body, isAlphaSequence, max); + values = expandSequence(m.body, isAlphaSequence, max, maxLength); } else { let n = parseCommaParts(m.body); @@ -59661,9 +59665,31 @@ function expand_(str, max, maxLength, isTop) { } /* c8 ignore stop */ } + // Values that `combine` is going to drop as empty produce no result, so + // they must not count against `max` - otherwise `{a,,b}` with `max: 2` + // would stop at `['a', '']` and yield one result instead of two. Skipping + // them outright keeps `values` bounded while leaving `max` a bound on + // *kept* results. + let dropsEmpties = dropEmpties && !m.post.length && !pre; + for (let d = 0; dropsEmpties && d < acc.length; d++) { + if (acc[d]) { + dropsEmpties = false; + } + } values = []; - for (let j = 0; j < n.length; j++) { - values.push.apply(values, expand_(n[j], max, maxLength, false)); + let valuesLength = 0; + outer: for (let j = 0; j < n.length; j++) { + const expanded = expand_(n[j], max, maxLength, false); + for (let k = 0; k < expanded.length; k++) { + const v = expanded[k]; + if (dropsEmpties && !v) + continue; + if (values.length >= max || valuesLength + v.length > maxLength) { + break outer; + } + values.push(v); + valuesLength += v.length; + } } } acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length); diff --git a/dist/setup/971.index.js b/dist/setup/971.index.js index 269496e2..d73a0c05 100644 --- a/dist/setup/971.index.js +++ b/dist/setup/971.index.js @@ -52532,7 +52532,7 @@ function combine(acc, pre, values, max, maxLength, dropEmpties) { } // The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`) // sequence body. -function expandSequence(body, isAlphaSequence, max) { +function expandSequence(body, isAlphaSequence, max, maxLength) { const n = body.split(/\.\./); const N = []; // A sequence body always splits into two or three parts, but the compiler @@ -52555,6 +52555,7 @@ function expandSequence(body, isAlphaSequence, max) { test = gte; } const pad = n.some(isPadded); + let length = 0; for (let i = x; test(i, y) && N.length < max; i += incr) { let c; if (isAlphaSequence) { @@ -52578,7 +52579,10 @@ function expandSequence(body, isAlphaSequence, max) { } } } + if (length + c.length > maxLength) + break; N.push(c); + length += c.length; } return N; } @@ -52632,7 +52636,7 @@ function expand_(str, max, maxLength, isTop) { } let values; if (isSequence) { - values = expandSequence(m.body, isAlphaSequence, max); + values = expandSequence(m.body, isAlphaSequence, max, maxLength); } else { let n = parseCommaParts(m.body); @@ -52650,9 +52654,31 @@ function expand_(str, max, maxLength, isTop) { } /* c8 ignore stop */ } + // Values that `combine` is going to drop as empty produce no result, so + // they must not count against `max` - otherwise `{a,,b}` with `max: 2` + // would stop at `['a', '']` and yield one result instead of two. Skipping + // them outright keeps `values` bounded while leaving `max` a bound on + // *kept* results. + let dropsEmpties = dropEmpties && !m.post.length && !pre; + for (let d = 0; dropsEmpties && d < acc.length; d++) { + if (acc[d]) { + dropsEmpties = false; + } + } values = []; - for (let j = 0; j < n.length; j++) { - values.push.apply(values, expand_(n[j], max, maxLength, false)); + let valuesLength = 0; + outer: for (let j = 0; j < n.length; j++) { + const expanded = expand_(n[j], max, maxLength, false); + for (let k = 0; k < expanded.length; k++) { + const v = expanded[k]; + if (dropsEmpties && !v) + continue; + if (values.length >= max || valuesLength + v.length > maxLength) { + break outer; + } + values.push(v); + valuesLength += v.length; + } } } acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length); diff --git a/package-lock.json b/package-lock.json index e4776783..f2a86fcf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2635,9 +2635,9 @@ } }, "node_modules/brace-expansion": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.8.tgz", - "integrity": "sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", + "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", "license": "MIT", "dependencies": { "balanced-match": "^4.0.2"