@reliverse/relinka 1.1.5 → 1.1.7

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.
Files changed (115) hide show
  1. package/dist-npm/components/anykey/index.js +77 -57
  2. package/dist-npm/components/block/block.js +61 -48
  3. package/dist-npm/components/checkbox/index.js +211 -178
  4. package/dist-npm/components/confirm/confirm-main.js +122 -85
  5. package/dist-npm/components/confirm/confirm-three.js +27 -24
  6. package/dist-npm/components/confirm/index.js +45 -36
  7. package/dist-npm/components/core/Separator.js +17 -15
  8. package/dist-npm/components/core/create-prompt.js +124 -101
  9. package/dist-npm/components/core/errors.js +15 -19
  10. package/dist-npm/components/core/hook-engine.js +120 -91
  11. package/dist-npm/components/core/index.js +12 -12
  12. package/dist-npm/components/core/key.js +6 -16
  13. package/dist-npm/components/core/lines.js +54 -45
  14. package/dist-npm/components/core/make-theme.js +30 -21
  15. package/dist-npm/components/core/position.js +23 -27
  16. package/dist-npm/components/core/promise-polyfill.js +14 -11
  17. package/dist-npm/components/core/screen-manager.js +74 -59
  18. package/dist-npm/components/core/theme.js +32 -22
  19. package/dist-npm/components/core/use-effect.js +15 -9
  20. package/dist-npm/components/core/use-keypress.js +23 -19
  21. package/dist-npm/components/core/use-memo.js +16 -10
  22. package/dist-npm/components/core/use-pagination.js +32 -33
  23. package/dist-npm/components/core/use-prefix.js +38 -40
  24. package/dist-npm/components/core/use-ref.js +5 -2
  25. package/dist-npm/components/core/use-state.js +23 -15
  26. package/dist-npm/components/core/useKeyPress.js +17 -14
  27. package/dist-npm/components/core/usePromptState.js +14 -8
  28. package/dist-npm/components/core/utils.js +16 -7
  29. package/dist-npm/components/date/date.js +204 -167
  30. package/dist-npm/components/editor/index.js +92 -71
  31. package/dist-npm/components/expand/index.js +124 -96
  32. package/dist-npm/components/figures/index.js +294 -283
  33. package/dist-npm/components/input/index.js +87 -61
  34. package/dist-npm/components/input/text-main.js +124 -97
  35. package/dist-npm/components/input/text.js +28 -24
  36. package/dist-npm/components/instance/basic.js +25 -17
  37. package/dist-npm/components/instance/browser.js +18 -14
  38. package/dist-npm/components/instance/reporter/basic.js +65 -46
  39. package/dist-npm/components/instance/reporter/browser.js +47 -44
  40. package/dist-npm/components/instance/reporter/fancy.js +96 -83
  41. package/dist-npm/components/instance/shared.js +2 -2
  42. package/dist-npm/components/mono/mono.js +62 -52
  43. package/dist-npm/components/mono/monoTwo.js +49 -35
  44. package/dist-npm/components/multiselect/group-multiselect.js +71 -55
  45. package/dist-npm/components/multiselect/multi-select-two.js +130 -97
  46. package/dist-npm/components/multiselect/multi-select.js +49 -43
  47. package/dist-npm/components/multiselect/multiselect-main.js +146 -120
  48. package/dist-npm/components/multiselect/num-multi-select.js +130 -97
  49. package/dist-npm/components/multiselect/num-multiselect-main.js +35 -24
  50. package/dist-npm/components/next-steps/next-steps.js +25 -23
  51. package/dist-npm/components/number/index.js +112 -78
  52. package/dist-npm/components/number/number-main.js +2 -95
  53. package/dist-npm/components/password/index.js +73 -54
  54. package/dist-npm/components/password/password-main.js +2 -119
  55. package/dist-npm/components/password/password-three.js +30 -26
  56. package/dist-npm/components/progressbar/ProgressBar.js +64 -45
  57. package/dist-npm/components/progressbar/helper.js +40 -33
  58. package/dist-npm/components/progressbar/index.js +1 -1
  59. package/dist-npm/components/prompts/create.js +44 -29
  60. package/dist-npm/components/prompts/index.js +45 -45
  61. package/dist-npm/components/prompts/prompt.js +260 -211
  62. package/dist-npm/components/prompts/promptTwo.js +605 -561
  63. package/dist-npm/components/prompts/relinka.js +295 -237
  64. package/dist-npm/components/range/range.js +294 -247
  65. package/dist-npm/components/rawlist/index.js +107 -87
  66. package/dist-npm/components/results/results.js +37 -31
  67. package/dist-npm/components/search/index.js +193 -148
  68. package/dist-npm/components/select/index.js +186 -148
  69. package/dist-npm/components/select/num-select-main.js +27 -27
  70. package/dist-npm/components/select/num-select.js +5 -124
  71. package/dist-npm/components/select/select-key.js +25 -24
  72. package/dist-npm/components/select/select-main.js +133 -109
  73. package/dist-npm/components/select/select-three.js +36 -32
  74. package/dist-npm/components/select/select-two.js +87 -94
  75. package/dist-npm/components/spinner/index.js +136 -107
  76. package/dist-npm/components/st-end/end.js +26 -34
  77. package/dist-npm/components/st-end/start.js +15 -29
  78. package/dist-npm/components/toggle/index.js +137 -113
  79. package/dist-npm/components/visual/animate/animate.js +10 -53
  80. package/dist-npm/components/visual/ascii-art/ascii-art.js +1 -12
  81. package/dist-npm/mod.js +2 -1
  82. package/dist-npm/testing/index.js +83 -58
  83. package/dist-npm/types/general.js +1 -0
  84. package/dist-npm/types/index.js +3 -2
  85. package/dist-npm/types/keypress.js +36 -35
  86. package/dist-npm/types/readline.js +1 -0
  87. package/dist-npm/types/relinka.js +1 -0
  88. package/dist-npm/types/utils.js +1 -0
  89. package/dist-npm/utils/box.js +137 -135
  90. package/dist-npm/utils/color.js +74 -65
  91. package/dist-npm/utils/colorize.js +156 -124
  92. package/dist-npm/utils/component.js +657 -532
  93. package/dist-npm/utils/constants.js +63 -64
  94. package/dist-npm/utils/core.js +3 -2
  95. package/dist-npm/utils/decoder.js +223 -244
  96. package/dist-npm/utils/error.js +9 -4
  97. package/dist-npm/utils/errors.js +4 -14
  98. package/dist-npm/utils/format.js +24 -19
  99. package/dist-npm/utils/keypress.js +414 -316
  100. package/dist-npm/utils/log.js +15 -11
  101. package/dist-npm/utils/mapping.js +52 -45
  102. package/dist-npm/utils/messages.js +183 -183
  103. package/dist-npm/utils/platforms.js +20 -16
  104. package/dist-npm/utils/prompt-tmp.js +286 -235
  105. package/dist-npm/utils/prompt-two.js +286 -235
  106. package/dist-npm/utils/readline.js +7 -5
  107. package/dist-npm/utils/skeleton.js +170 -130
  108. package/dist-npm/utils/stream.js +2 -2
  109. package/dist-npm/utils/string.js +58 -44
  110. package/dist-npm/utils/terminal.js +34 -23
  111. package/dist-npm/utils/tree.js +41 -30
  112. package/dist-npm/utils/types.js +1 -0
  113. package/dist-npm/utils/utils.js +8 -8
  114. package/dist-npm/utils/variants.js +44 -36
  115. package/package.json +20 -28
@@ -1,190 +1,227 @@
1
- import { Type } from "@sinclair/typebox";
2
- import { Value } from "@sinclair/typebox/value";
3
- import { stdin as input, stdout as output } from "node:process";
4
- import readline from "node:readline/promises";
1
+ import {Type} from '@sinclair/typebox';
2
+ import {Value} from '@sinclair/typebox/value';
5
3
  import {
6
- buildRegExp,
7
- digit,
8
- endOfString,
9
- repeat,
10
- startOfString
11
- } from "ts-regex-builder";
12
- import { fmt, msg } from "../../utils/messages.js";
4
+ stdin as input,
5
+ stdout as output,
6
+ } from 'node:process';
7
+ import readline from 'node:readline/promises';
13
8
  import {
14
- countLines,
15
- deleteLastLine,
16
- deleteLastLines
17
- } from "../../utils/terminal.js";
9
+ buildRegExp,
10
+ digit,
11
+ endOfString,
12
+ repeat,
13
+ startOfString,
14
+ } from 'ts-regex-builder';
15
+ import {fmt, msg} from '../../utils/messages.js';
16
+ import {
17
+ countLines,
18
+ deleteLastLine,
19
+ deleteLastLines,
20
+ } from '../../utils/terminal.js';
21
+
22
+ const isString = (a) => typeof a === 'string';
23
+
18
24
  const twoDigits = repeat(digit, 2);
19
25
  const fourDigits = repeat(digit, 4);
20
- const separatorDot = ".";
21
- const separatorSlash = "/";
26
+ const separatorDot = '.';
27
+ const separatorSlash = '/';
28
+
22
29
  const regexDDMMYYYY = buildRegExp([
23
- startOfString,
24
- twoDigits,
25
-
26
- separatorDot,
27
- twoDigits,
28
-
29
- separatorDot,
30
- fourDigits,
31
-
32
- endOfString
30
+ startOfString,
31
+ twoDigits,
32
+ separatorDot,
33
+ twoDigits,
34
+ separatorDot,
35
+ fourDigits,
36
+ endOfString,
33
37
  ]);
38
+
34
39
  const regexMMDDYYYY = buildRegExp([
35
- startOfString,
36
- twoDigits,
37
-
38
- separatorSlash,
39
- twoDigits,
40
-
41
- separatorSlash,
42
- fourDigits,
43
-
44
- endOfString
40
+ startOfString,
41
+ twoDigits,
42
+ separatorSlash,
43
+ twoDigits,
44
+ separatorSlash,
45
+ fourDigits,
46
+ endOfString,
45
47
  ]);
48
+
46
49
  const regexYYYYMMDD = buildRegExp([
47
- startOfString,
48
- fourDigits,
49
-
50
- separatorDot,
51
- twoDigits,
52
-
53
- separatorDot,
54
- twoDigits,
55
-
56
- endOfString
50
+ startOfString,
51
+ fourDigits,
52
+ separatorDot,
53
+ twoDigits,
54
+ separatorDot,
55
+ twoDigits,
56
+ endOfString,
57
57
  ]);
58
+
58
59
  const dateFormatSchema = Type.Union([
59
- Type.RegExp(regexDDMMYYYY, { description: "DD.MM.YYYY" }),
60
- Type.RegExp(regexMMDDYYYY, { description: "MM/DD/YYYY" }),
61
- Type.RegExp(regexYYYYMMDD, { description: "YYYY.MM.DD" })
60
+ Type.RegExp(regexDDMMYYYY, {
61
+ description: 'DD.MM.YYYY',
62
+ }),
63
+ Type.RegExp(regexMMDDYYYY, {
64
+ description: 'MM/DD/YYYY',
65
+ }),
66
+ Type.RegExp(regexYYYYMMDD, {
67
+ description: 'YYYY.MM.DD',
68
+ }),
62
69
  ]);
70
+
63
71
  export async function datePrompt(options) {
64
- const {
65
- title,
66
- dateFormat,
67
- dateKind,
68
- hint,
69
- validate,
70
- defaultValue,
71
- schema,
72
- titleColor = "cyanBright",
73
- titleTypography = "bold",
74
- titleVariant,
75
- content,
76
- contentColor,
77
- contentTypography,
78
- contentVariant,
79
- borderColor = "viceGradient",
80
- variantOptions
81
- } = options;
82
- const rl = readline.createInterface({ input, output });
83
- let linesToDelete = 0;
84
- let errorMessage = "";
85
- try {
86
- while (true) {
87
- if (linesToDelete > 0) {
88
- deleteLastLines(linesToDelete);
89
- }
90
- const questionText = fmt({
91
- type: errorMessage !== "" ? "M_ERROR" : "M_GENERAL",
92
- title: `${title} [Format: ${dateFormat}]`,
93
- titleColor,
94
- titleTypography,
72
+ const {
73
+ title,
74
+ dateFormat,
75
+ dateKind,
76
+ hint,
77
+ validate,
78
+ defaultValue,
79
+ schema,
80
+ titleColor = 'cyanBright',
81
+ titleTypography = 'bold',
95
82
  titleVariant,
96
83
  content,
97
84
  contentColor,
98
85
  contentTypography,
99
86
  contentVariant,
100
- borderColor,
101
- hint,
87
+ borderColor = 'viceGradient',
102
88
  variantOptions,
103
- errorMessage,
104
- addNewLineBefore: false
105
- });
106
- const questionLines = countLines(questionText);
107
- linesToDelete = questionLines + 1;
108
- msg({ type: "M_GENERAL", title: questionText });
109
- const answer = (await rl.question("> ")).trim() || defaultValue;
110
- if (answer === defaultValue && defaultValue) {
111
- deleteLastLine();
112
- msg({
113
- type: "M_MIDDLE",
114
- title: ` ${defaultValue}`,
115
- titleColor: "none"
116
- });
117
- }
118
- if (!Value.Check(dateFormatSchema, answer)) {
119
- errorMessage = `Please enter a valid date in ${dateFormat} format.`;
120
- msg({ type: "M_ERROR", title: errorMessage });
121
- continue;
122
- }
123
- let matchedFormat = null;
124
- if (regexDDMMYYYY.test(answer)) {
125
- matchedFormat = "DD.MM.YYYY";
126
- } else if (regexMMDDYYYY.test(answer)) {
127
- matchedFormat = "MM/DD/YYYY";
128
- } else if (regexYYYYMMDD.test(answer)) {
129
- matchedFormat = "YYYY.MM.DD";
130
- }
131
- if (dateKind === "birthday" && matchedFormat) {
132
- const parts = answer.split(/[./-]/);
133
- let date;
134
- if (matchedFormat === "DD.MM.YYYY") {
135
- date = new Date(
136
- Number(parts[2]),
137
- Number(parts[1]) - 1,
138
- Number(parts[0])
139
- );
140
- } else if (matchedFormat === "MM/DD/YYYY") {
141
- date = new Date(
142
- Number(parts[2]),
143
- Number(parts[0]) - 1,
144
- Number(parts[1])
145
- );
146
- } else if (matchedFormat === "YYYY.MM.DD") {
147
- date = new Date(
148
- Number(parts[0]),
149
- Number(parts[1]) - 1,
150
- Number(parts[2])
151
- );
152
- } else {
153
- date = new Date(answer);
154
- }
155
- if (isNaN(date.getTime()) || date.getFullYear() < 1900 || date > new Date()) {
156
- errorMessage = "Please enter a valid birthday date (e.g., 14.09.1999).";
157
- msg({ type: "M_ERROR", title: errorMessage });
158
- continue;
159
- }
160
- }
161
- let isValid = true;
162
- errorMessage = "";
163
- if (schema) {
164
- isValid = Value.Check(schema, answer);
165
- if (!isValid) {
166
- const errors = [...Value.Errors(schema, answer)];
167
- errorMessage = errors[0]?.message ?? "Invalid input.";
168
- msg({ type: "M_ERROR", title: errorMessage });
169
- continue;
170
- }
171
- }
172
- if (validate && isValid) {
173
- const validation = await validate(answer);
174
- if (validation !== true) {
175
- isValid = false;
176
- errorMessage = typeof validation === "string" ? validation : "Invalid input.";
177
- msg({ type: "M_ERROR", title: errorMessage });
178
- continue;
89
+ } = options;
90
+
91
+ const rl = readline.createInterface({
92
+ input,
93
+ output,
94
+ });
95
+ let linesToDelete = 0;
96
+ let errorMessage = '';
97
+
98
+ try {
99
+ while (true) {
100
+ if (linesToDelete > 0) {
101
+ deleteLastLines(linesToDelete);
102
+ }
103
+
104
+ const questionText = fmt({
105
+ type: errorMessage !== '' ? 'M_ERROR' : 'M_GENERAL',
106
+ title: `${title} [Format: ${dateFormat}]`,
107
+ titleColor,
108
+ titleTypography,
109
+ titleVariant,
110
+ content,
111
+ contentColor,
112
+ contentTypography,
113
+ contentVariant,
114
+ borderColor,
115
+ hint,
116
+ variantOptions,
117
+ errorMessage,
118
+ addNewLineBefore: false,
119
+ });
120
+
121
+ const questionLines = countLines(questionText);
122
+
123
+ linesToDelete = questionLines + 1;
124
+ msg({
125
+ type: 'M_GENERAL',
126
+ title: questionText,
127
+ });
128
+ const answer = (await rl.question('> ')).trim() || defaultValue;
129
+
130
+ if (answer === defaultValue && defaultValue) {
131
+ deleteLastLine();
132
+ msg({
133
+ type: 'M_MIDDLE',
134
+ title: ` ${defaultValue}`,
135
+ titleColor: 'none',
136
+ });
137
+ }
138
+
139
+ if (!Value.Check(dateFormatSchema, answer)) {
140
+ errorMessage = `Please enter a valid date in ${dateFormat} format.`;
141
+ msg({
142
+ type: 'M_ERROR',
143
+ title: errorMessage,
144
+ });
145
+ continue;
146
+ }
147
+
148
+ let matchedFormat = null;
149
+
150
+ if (regexDDMMYYYY.test(answer)) {
151
+ matchedFormat = 'DD.MM.YYYY';
152
+ } else if (regexMMDDYYYY.test(answer)) {
153
+ matchedFormat = 'MM/DD/YYYY';
154
+ } else if (regexYYYYMMDD.test(answer)) {
155
+ matchedFormat = 'YYYY.MM.DD';
156
+ }
157
+
158
+
159
+ if (dateKind === 'birthday' && matchedFormat) {
160
+ const parts = answer.split(/[./-]/);
161
+ let date;
162
+
163
+ if (matchedFormat === 'DD.MM.YYYY') {
164
+ date = new Date(Number(parts[2]), Number(parts[1]) - 1, Number(parts[0]));
165
+ } else if (matchedFormat === 'MM/DD/YYYY') {
166
+ date = new Date(Number(parts[2]), Number(parts[0]) - 1, Number(parts[1]));
167
+ } else if (matchedFormat === 'YYYY.MM.DD') {
168
+ date = new Date(Number(parts[0]), Number(parts[1]) - 1, Number(parts[2]));
169
+ } else {
170
+ date = new Date(answer);
171
+ }
172
+
173
+
174
+ if (isNaN(date.getTime()) || date.getFullYear() < 1900 || date > new Date()) {
175
+ errorMessage = 'Please enter a valid birthday date (e.g., 14.09.1999).';
176
+ msg({
177
+ type: 'M_ERROR',
178
+ title: errorMessage,
179
+ });
180
+ continue;
181
+ }
182
+ }
183
+
184
+ let isValid = true;
185
+
186
+ errorMessage = '';
187
+ if (schema) {
188
+ isValid = Value.Check(schema, answer);
189
+ if (!isValid) {
190
+ const errors = Value.Errors(schema, answer);
191
+
192
+ errorMessage = errors[0]?.message ?? 'Invalid input.';
193
+ msg({
194
+ type: 'M_ERROR',
195
+ title: errorMessage,
196
+ });
197
+ continue;
198
+ }
199
+ }
200
+
201
+ if (validate && isValid) {
202
+ const validation = await validate(answer);
203
+
204
+ if (!validation) {
205
+ isValid = false;
206
+ errorMessage = isString(validation) ? validation : 'Invalid input.';
207
+ msg({
208
+ type: 'M_ERROR',
209
+ title: errorMessage,
210
+ });
211
+ continue;
212
+ }
213
+ }
214
+
215
+ if (isValid) {
216
+ msg({
217
+ type: 'M_NEWLINE',
218
+ title: '',
219
+ });
220
+ rl.close();
221
+ return answer;
222
+ }
179
223
  }
180
- }
181
- if (isValid) {
182
- msg({ type: "M_NEWLINE", title: "" });
224
+ } finally {
183
225
  rl.close();
184
- return answer;
185
- }
186
226
  }
187
- } finally {
188
- rl.close();
189
- }
190
227
  }
@@ -1,78 +1,99 @@
1
- import { editAsync } from "external-editor";
2
- import { AsyncResource } from "node:async_hooks";
1
+ import {editAsync} from 'external-editor';
2
+ import {AsyncResource} from 'node:async_hooks';
3
3
  import {
4
- createPrompt,
5
- useEffect,
6
- useState,
7
- useKeypress,
8
- usePrefix,
9
- isEnterKey,
10
- makeTheme
11
- } from "../../components/core/index.js";
4
+ createPrompt,
5
+ useEffect,
6
+ useState,
7
+ useKeypress,
8
+ usePrefix,
9
+ isEnterKey,
10
+ makeTheme,
11
+ } from '../../components/core/index.js';
12
+
12
13
  export default createPrompt((config, done) => {
13
- const {
14
- waitForUseInput = true,
15
- file: { postfix = config.postfix ?? ".txt", ...fileProps } = {},
16
- validate = () => true
17
- } = config;
18
- const theme = makeTheme(config.theme);
19
- const [status, setStatus] = useState("idle");
20
- const [value, setValue] = useState(config.default || "");
21
- const [errorMsg, setError] = useState();
22
- const prefix = usePrefix({ status, theme });
23
- function startEditor(rl) {
24
- rl.pause();
25
- const editCallback = AsyncResource.bind(
26
- async (error2, answer) => {
27
- rl.resume();
28
- if (error2) {
29
- setError(error2.toString());
30
- } else {
31
- setStatus("loading");
32
- const isValid = await validate(answer);
33
- if (isValid === true) {
34
- setError(void 0);
35
- setStatus("done");
36
- done(answer);
37
- } else {
38
- setValue(answer);
39
- setError(isValid || "You must provide a valid value");
40
- setStatus("idle");
41
- }
42
- }
43
- }
44
- );
45
- editAsync(value, (error2, answer) => void editCallback(error2, answer), {
46
- postfix,
47
- ...fileProps
14
+ const {
15
+ waitForUseInput = true,
16
+ file: {postfix = config.postfix ?? '.txt', ...fileProps} = {},
17
+ validate = () => true,
18
+ } = config;
19
+
20
+ const theme = makeTheme(config.theme);
21
+ const [status, setStatus] = useState('idle');
22
+ const [value, setValue] = useState(config.default || '');
23
+ const [errorMsg, setError] = useState();
24
+ const prefix = usePrefix({
25
+ status,
26
+ theme,
48
27
  });
49
- }
50
- useEffect((rl) => {
51
- if (!waitForUseInput) {
52
- startEditor(rl);
28
+
29
+ function startEditor(rl) {
30
+ rl.pause();
31
+ const editCallback = AsyncResource.bind(async (error2, answer) => {
32
+ rl.resume();
33
+ if (error2) {
34
+ setError(error2.toString());
35
+ } else {
36
+ setStatus('loading');
37
+ const isValid = await validate(answer);
38
+
39
+ if (isValid) {
40
+ setError(void 0);
41
+ setStatus('done');
42
+ done(answer);
43
+ } else {
44
+ setValue(answer);
45
+ setError(isValid || 'You must provide a valid value');
46
+ setStatus('idle');
47
+ }
48
+ }
49
+ });
50
+
51
+ editAsync(value, (error2, answer) => void editCallback(error2, answer), {
52
+ postfix,
53
+ ...fileProps,
54
+ });
53
55
  }
54
- }, []);
55
- useKeypress((key, rl) => {
56
- if (status !== "idle") {
57
- return;
56
+
57
+ useEffect((rl) => {
58
+ if (!waitForUseInput) {
59
+ startEditor(rl);
60
+ }
61
+ }, []);
62
+ useKeypress((key, rl) => {
63
+ if (status !== 'idle') {
64
+ return;
65
+ }
66
+
67
+ if (isEnterKey(key)) {
68
+ startEditor(rl);
69
+ }
70
+ });
71
+ const message = theme.style.message(config.message, status);
72
+ let helpTip = '';
73
+
74
+ if (status === 'loading') {
75
+ helpTip = theme.style.help('Received');
76
+ } else if (status === 'idle') {
77
+ const enterKey = theme.style.key('enter');
78
+
79
+ helpTip = theme.style.help(`Press ${enterKey} to launch your preferred editor.`);
58
80
  }
59
- if (isEnterKey(key)) {
60
- startEditor(rl);
81
+
82
+
83
+ let error = '';
84
+
85
+ if (errorMsg) {
86
+ error = theme.style.error(errorMsg);
61
87
  }
62
- });
63
- const message = theme.style.message(config.message, status);
64
- let helpTip = "";
65
- if (status === "loading") {
66
- helpTip = theme.style.help("Received");
67
- } else if (status === "idle") {
68
- const enterKey = theme.style.key("enter");
69
- helpTip = theme.style.help(
70
- `Press ${enterKey} to launch your preferred editor.`
71
- );
72
- }
73
- let error = "";
74
- if (errorMsg) {
75
- error = theme.style.error(errorMsg);
76
- }
77
- return [[prefix, message, helpTip].filter(Boolean).join(" "), error];
88
+
89
+ return [
90
+ [
91
+ prefix,
92
+ message,
93
+ helpTip,
94
+ ]
95
+ .filter(Boolean)
96
+ .join(' '),
97
+ error,
98
+ ];
78
99
  });