Skip to content

Commit e865d19

Browse files
committed
fix(ng-dev): change default of confirm prompt to false
Change the default of the confirm prompt to be false instead of true
1 parent 63dad12 commit e865d19

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed

.github/local-actions/branch-manager/main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59159,7 +59159,13 @@ ${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes4.default.cursor
5915959159
//
5916059160
var Prompt = class {
5916159161
};
59162-
Prompt.confirm = esm_default4;
59162+
Prompt.confirm = (_config, _context) => {
59163+
const config = {
59164+
default: false,
59165+
..._config
59166+
};
59167+
return esm_default4(config, _context);
59168+
};
5916359169
Prompt.input = esm_default5;
5916459170
Prompt.checkbox = esm_default2;
5916559171
Prompt.select = esm_default11;

.github/local-actions/changelog/main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58722,7 +58722,13 @@ ${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes4.default.cursor
5872258722
//
5872358723
var Prompt = class {
5872458724
};
58725-
Prompt.confirm = esm_default4;
58725+
Prompt.confirm = (_config, _context) => {
58726+
const config2 = {
58727+
default: false,
58728+
..._config
58729+
};
58730+
return esm_default4(config2, _context);
58731+
};
5872658732
Prompt.input = esm_default5;
5872758733
Prompt.checkbox = esm_default2;
5872858734
Prompt.select = esm_default11;

github-actions/slash-commands/main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59056,7 +59056,13 @@ ${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes4.default.cursor
5905659056
//
5905759057
var Prompt = class {
5905859058
};
59059-
Prompt.confirm = esm_default4;
59059+
Prompt.confirm = (_config, _context) => {
59060+
const config = {
59061+
default: false,
59062+
..._config
59063+
};
59064+
return esm_default4(config, _context);
59065+
};
5906059066
Prompt.input = esm_default5;
5906159067
Prompt.checkbox = esm_default2;
5906259068
Prompt.select = esm_default11;

ng-dev/utils/prompt.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,18 @@ import {confirm, input, checkbox, select, editor} from '@inquirer/prompts';
1313
* class to allow easier mocking management in test environments.
1414
*/
1515
export class Prompt {
16-
static confirm: typeof confirm = confirm;
16+
static confirm: typeof confirm = (
17+
// These are extractions of the PromptConfig from the inquirer types.
18+
_config: Parameters<typeof confirm>[0],
19+
_context: Parameters<typeof confirm>[1],
20+
) => {
21+
/** Config to use when creating a confirm prompt, changes the default to `false` instead of `true`. */
22+
const config = {
23+
default: false,
24+
..._config,
25+
};
26+
return confirm(config, _context);
27+
};
1728
static input: typeof input = input;
1829
static checkbox: typeof checkbox = checkbox;
1930
static select: typeof select = select;

0 commit comments

Comments
 (0)