@optique/core 0.8.12 → 0.8.13

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/dist/usage.cjs CHANGED
@@ -186,8 +186,10 @@ function normalizeUsageTerm(term) {
186
186
  const terms = [];
187
187
  for (const usage of term.terms) {
188
188
  const normalized = normalizeUsage(usage);
189
- if (normalized.length === 1 && normalized[0].type === "exclusive") for (const subUsage of normalized[0].terms) terms.push(subUsage);
190
- else terms.push(normalized);
189
+ if (normalized.length >= 1 && normalized[0].type === "exclusive") {
190
+ const rest = normalized.slice(1);
191
+ for (const subUsage of normalized[0].terms) terms.push([...subUsage, ...rest]);
192
+ } else terms.push(normalized);
191
193
  }
192
194
  return {
193
195
  type: "exclusive",
package/dist/usage.js CHANGED
@@ -185,8 +185,10 @@ function normalizeUsageTerm(term) {
185
185
  const terms = [];
186
186
  for (const usage of term.terms) {
187
187
  const normalized = normalizeUsage(usage);
188
- if (normalized.length === 1 && normalized[0].type === "exclusive") for (const subUsage of normalized[0].terms) terms.push(subUsage);
189
- else terms.push(normalized);
188
+ if (normalized.length >= 1 && normalized[0].type === "exclusive") {
189
+ const rest = normalized.slice(1);
190
+ for (const subUsage of normalized[0].terms) terms.push([...subUsage, ...rest]);
191
+ } else terms.push(normalized);
190
192
  }
191
193
  return {
192
194
  type: "exclusive",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "0.8.12",
3
+ "version": "0.8.13",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",