Skip to content

Commit cc11917

Browse files
committed
update default password mask
1 parent 6609d01 commit cc11917

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

.changeset/mean-pots-check.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clack/prompts': patch
3+
---
4+
5+
Update default `password` mask

examples/basic/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ async function main() {
2323
password: () =>
2424
p.password({
2525
message: 'Provide a password',
26-
mask: '🧹',
2726
validate: (value) => {
2827
if (!value) return 'Please enter a password.';
2928
if (value.length < 5) return 'Password should have at least 5 characters.';

packages/prompts/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const S_RADIO_INACTIVE = s('○', ' ');
3131
const S_CHECKBOX_ACTIVE = s('◻', '[•]');
3232
const S_CHECKBOX_SELECTED = s('◼', '[+]');
3333
const S_CHECKBOX_INACTIVE = s('◻', '[ ]');
34+
const S_PASSWORD_MASK = s('▪', '•');
3435

3536
const S_BAR_H = s('─', '-');
3637
const S_CORNER_TOP_RIGHT = s('╮', '+');
@@ -97,7 +98,7 @@ export interface PasswordOptions {
9798
export const password = (opts: PasswordOptions) => {
9899
return new PasswordPrompt({
99100
validate: opts.validate,
100-
mask: opts.mask,
101+
mask: opts.mask ?? S_PASSWORD_MASK,
101102
render() {
102103
const title = `${color.gray(S_BAR)}\n${symbol(this.state)} ${opts.message}\n`;
103104
const value = this.valueWithCursor;

0 commit comments

Comments
 (0)