MCPcopy Index your code
hub / github.com/yargs/yargs / defaultString

Function defaultString

lib/usage.ts:650–671  ·  view source on GitHub ↗
(value: any, defaultDescription?: string)

Source from the content-addressed store, hash-verified

648 // format the default-value-string displayed in
649 // the right-hand column.
650 function defaultString(value: any, defaultDescription?: string) {
651 let string = `[${__('default:')} `;
652
653 if (value === undefined && !defaultDescription) return null;
654
655 if (defaultDescription) {
656 string += defaultDescription;
657 } else {
658 switch (typeof value) {
659 case 'string':
660 string += `"${value}"`;
661 break;
662 case 'object':
663 string += JSON.stringify(value);
664 break;
665 default:
666 string += value;
667 }
668 }
669
670 return `${string}]`;
671 }
672
673 // guess the width of the console window, max-width 80.
674 function windowWidth() {

Callers 1

usageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…