(value: any, defaultDescription?: string)
| 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() { |
no outgoing calls
no test coverage detected
searching dependent graphs…