@optique/core 0.7.16 → 0.7.17-dev.396
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/constructs.cjs +8 -3
- package/dist/constructs.js +8 -3
- package/package.json +1 -1
package/dist/constructs.cjs
CHANGED
|
@@ -1133,9 +1133,14 @@ function group(label, parser) {
|
|
|
1133
1133
|
kind: "available",
|
|
1134
1134
|
state: parser.initialState
|
|
1135
1135
|
}, void 0);
|
|
1136
|
-
const
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1136
|
+
const initialCommandNames = /* @__PURE__ */ new Set();
|
|
1137
|
+
for (const f of initialFragments.fragments) if (f.type === "entry" && f.term.type === "command") initialCommandNames.add(f.term.name);
|
|
1138
|
+
else if (f.type === "section") {
|
|
1139
|
+
for (const e of f.entries) if (e.term.type === "command") initialCommandNames.add(e.term.name);
|
|
1140
|
+
}
|
|
1141
|
+
const initialHasCommands = initialCommandNames.size > 0;
|
|
1142
|
+
const currentCommandsAreGroupOwn = allEntries.some((e) => e.term.type === "command" && initialCommandNames.has(e.term.name));
|
|
1143
|
+
const applyLabel = !initialHasCommands || currentCommandsAreGroupOwn;
|
|
1139
1144
|
const labeledSection = applyLabel ? {
|
|
1140
1145
|
title: label,
|
|
1141
1146
|
entries: allEntries
|
package/dist/constructs.js
CHANGED
|
@@ -1133,9 +1133,14 @@ function group(label, parser) {
|
|
|
1133
1133
|
kind: "available",
|
|
1134
1134
|
state: parser.initialState
|
|
1135
1135
|
}, void 0);
|
|
1136
|
-
const
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1136
|
+
const initialCommandNames = /* @__PURE__ */ new Set();
|
|
1137
|
+
for (const f of initialFragments.fragments) if (f.type === "entry" && f.term.type === "command") initialCommandNames.add(f.term.name);
|
|
1138
|
+
else if (f.type === "section") {
|
|
1139
|
+
for (const e of f.entries) if (e.term.type === "command") initialCommandNames.add(e.term.name);
|
|
1140
|
+
}
|
|
1141
|
+
const initialHasCommands = initialCommandNames.size > 0;
|
|
1142
|
+
const currentCommandsAreGroupOwn = allEntries.some((e) => e.term.type === "command" && initialCommandNames.has(e.term.name));
|
|
1143
|
+
const applyLabel = !initialHasCommands || currentCommandsAreGroupOwn;
|
|
1139
1144
|
const labeledSection = applyLabel ? {
|
|
1140
1145
|
title: label,
|
|
1141
1146
|
entries: allEntries
|