@optique/core 1.0.0-dev.1492 → 1.0.0-dev.1495

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/doc.cjs CHANGED
@@ -250,9 +250,9 @@ function formatDocPage(programName, page, options = {}) {
250
250
  const entryMin = needsDescColumn ? Math.min(splitEntryMin, fixedEntryMin) : hasEntries ? termIndent + 1 : 1;
251
251
  const usageMin = page.usage != null ? 7 + Math.max(programName.length, Math.min(maxVisibleAtomicWidth(page.usage), programName.length + 7)) : 1;
252
252
  let sectionMin = 1;
253
- if (page.examples != null) sectionMin = Math.max(sectionMin, 9);
254
- if (page.author != null) sectionMin = Math.max(sectionMin, 7);
255
- if (page.bugs != null) sectionMin = Math.max(sectionMin, 5);
253
+ if (hasContent(page.examples)) sectionMin = Math.max(sectionMin, 9);
254
+ if (hasContent(page.author)) sectionMin = Math.max(sectionMin, 7);
255
+ if (hasContent(page.bugs)) sectionMin = Math.max(sectionMin, 5);
256
256
  const minWidth = Math.max(entryMin, usageMin, sectionMin);
257
257
  if (options.maxWidth < minWidth) throw new RangeError(`maxWidth must be at least ${minWidth}, got ${options.maxWidth}.`);
258
258
  if (needsDescColumn && minDescWidth > 1) {
@@ -272,7 +272,7 @@ function formatDocPage(programName, page, options = {}) {
272
272
  effectiveTermWidth = availableForColumns >= termWidth + 1 ? termWidth : Math.max(1, Math.floor(availableForColumns / 2));
273
273
  }
274
274
  let output = "";
275
- if (page.brief != null) {
275
+ if (hasContent(page.brief)) {
276
276
  output += require_message.formatMessage(page.brief, {
277
277
  colors: options.colors,
278
278
  maxWidth: options.maxWidth,
@@ -290,7 +290,7 @@ function formatDocPage(programName, page, options = {}) {
290
290
  }), 7);
291
291
  output += "\n";
292
292
  }
293
- if (page.description != null) {
293
+ if (hasContent(page.description)) {
294
294
  output += "\n";
295
295
  output += require_message.formatMessage(page.description, {
296
296
  colors: options.colors,
@@ -402,7 +402,7 @@ function formatDocPage(programName, page, options = {}) {
402
402
  output += `${" ".repeat(termIndent)}${ansiAwareRightPad(term, effectiveTermWidth)}${description === "" ? "" : ` ${indentLines(description, termIndent + effectiveTermWidth + 2)}`}\n`;
403
403
  }
404
404
  }
405
- if (page.examples != null) {
405
+ if (hasContent(page.examples)) {
406
406
  output += "\n";
407
407
  const examplesLabel = options.colors ? "\x1B[1;2mExamples:\x1B[0m\n" : "Examples:\n";
408
408
  output += examplesLabel;
@@ -414,7 +414,7 @@ function formatDocPage(programName, page, options = {}) {
414
414
  output += " " + indentLines(examplesContent, 2);
415
415
  output += "\n";
416
416
  }
417
- if (page.author != null) {
417
+ if (hasContent(page.author)) {
418
418
  output += "\n";
419
419
  const authorLabel = options.colors ? "\x1B[1;2mAuthor:\x1B[0m\n" : "Author:\n";
420
420
  output += authorLabel;
@@ -426,7 +426,7 @@ function formatDocPage(programName, page, options = {}) {
426
426
  output += " " + indentLines(authorContent, 2);
427
427
  output += "\n";
428
428
  }
429
- if (page.bugs != null) {
429
+ if (hasContent(page.bugs)) {
430
430
  output += "\n";
431
431
  const bugsLabel = options.colors ? "\x1B[1;2mBugs:\x1B[0m\n" : "Bugs:\n";
432
432
  output += bugsLabel;
@@ -438,7 +438,7 @@ function formatDocPage(programName, page, options = {}) {
438
438
  output += " " + indentLines(bugsContent, 2);
439
439
  output += "\n";
440
440
  }
441
- if (page.footer != null) {
441
+ if (hasContent(page.footer)) {
442
442
  output += "\n";
443
443
  output += require_message.formatMessage(page.footer, {
444
444
  colors: options.colors,
package/dist/doc.js CHANGED
@@ -250,9 +250,9 @@ function formatDocPage(programName, page, options = {}) {
250
250
  const entryMin = needsDescColumn ? Math.min(splitEntryMin, fixedEntryMin) : hasEntries ? termIndent + 1 : 1;
251
251
  const usageMin = page.usage != null ? 7 + Math.max(programName.length, Math.min(maxVisibleAtomicWidth(page.usage), programName.length + 7)) : 1;
252
252
  let sectionMin = 1;
253
- if (page.examples != null) sectionMin = Math.max(sectionMin, 9);
254
- if (page.author != null) sectionMin = Math.max(sectionMin, 7);
255
- if (page.bugs != null) sectionMin = Math.max(sectionMin, 5);
253
+ if (hasContent(page.examples)) sectionMin = Math.max(sectionMin, 9);
254
+ if (hasContent(page.author)) sectionMin = Math.max(sectionMin, 7);
255
+ if (hasContent(page.bugs)) sectionMin = Math.max(sectionMin, 5);
256
256
  const minWidth = Math.max(entryMin, usageMin, sectionMin);
257
257
  if (options.maxWidth < minWidth) throw new RangeError(`maxWidth must be at least ${minWidth}, got ${options.maxWidth}.`);
258
258
  if (needsDescColumn && minDescWidth > 1) {
@@ -272,7 +272,7 @@ function formatDocPage(programName, page, options = {}) {
272
272
  effectiveTermWidth = availableForColumns >= termWidth + 1 ? termWidth : Math.max(1, Math.floor(availableForColumns / 2));
273
273
  }
274
274
  let output = "";
275
- if (page.brief != null) {
275
+ if (hasContent(page.brief)) {
276
276
  output += formatMessage(page.brief, {
277
277
  colors: options.colors,
278
278
  maxWidth: options.maxWidth,
@@ -290,7 +290,7 @@ function formatDocPage(programName, page, options = {}) {
290
290
  }), 7);
291
291
  output += "\n";
292
292
  }
293
- if (page.description != null) {
293
+ if (hasContent(page.description)) {
294
294
  output += "\n";
295
295
  output += formatMessage(page.description, {
296
296
  colors: options.colors,
@@ -402,7 +402,7 @@ function formatDocPage(programName, page, options = {}) {
402
402
  output += `${" ".repeat(termIndent)}${ansiAwareRightPad(term, effectiveTermWidth)}${description === "" ? "" : ` ${indentLines(description, termIndent + effectiveTermWidth + 2)}`}\n`;
403
403
  }
404
404
  }
405
- if (page.examples != null) {
405
+ if (hasContent(page.examples)) {
406
406
  output += "\n";
407
407
  const examplesLabel = options.colors ? "\x1B[1;2mExamples:\x1B[0m\n" : "Examples:\n";
408
408
  output += examplesLabel;
@@ -414,7 +414,7 @@ function formatDocPage(programName, page, options = {}) {
414
414
  output += " " + indentLines(examplesContent, 2);
415
415
  output += "\n";
416
416
  }
417
- if (page.author != null) {
417
+ if (hasContent(page.author)) {
418
418
  output += "\n";
419
419
  const authorLabel = options.colors ? "\x1B[1;2mAuthor:\x1B[0m\n" : "Author:\n";
420
420
  output += authorLabel;
@@ -426,7 +426,7 @@ function formatDocPage(programName, page, options = {}) {
426
426
  output += " " + indentLines(authorContent, 2);
427
427
  output += "\n";
428
428
  }
429
- if (page.bugs != null) {
429
+ if (hasContent(page.bugs)) {
430
430
  output += "\n";
431
431
  const bugsLabel = options.colors ? "\x1B[1;2mBugs:\x1B[0m\n" : "Bugs:\n";
432
432
  output += bugsLabel;
@@ -438,7 +438,7 @@ function formatDocPage(programName, page, options = {}) {
438
438
  output += " " + indentLines(bugsContent, 2);
439
439
  output += "\n";
440
440
  }
441
- if (page.footer != null) {
441
+ if (hasContent(page.footer)) {
442
442
  output += "\n";
443
443
  output += formatMessage(page.footer, {
444
444
  colors: options.colors,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.0.0-dev.1492+3035da3f",
3
+ "version": "1.0.0-dev.1495+f6fe8a79",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",