@inquirer/password 1.1.6 → 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.
package/dist/cjs/index.js CHANGED
@@ -12,7 +12,8 @@ const password = (config, context) => {
12
12
  }
13
13
  return (0, input_1.default)(Object.assign(Object.assign({}, config), { default: undefined, transformer(input, { isFinal }) {
14
14
  if (config.mask) {
15
- return String(config.mask).repeat(input.length);
15
+ const maskChar = typeof config.mask === 'string' ? config.mask : '*';
16
+ return maskChar.repeat(input.length);
16
17
  }
17
18
  if (!isFinal) {
18
19
  return `${chalk_1.default.dim('[input is masked]')}${ansi_escapes_1.default.cursorHide}`;
@@ -10,7 +10,8 @@ const password = (config, context) => {
10
10
  default: undefined,
11
11
  transformer(input, { isFinal }) {
12
12
  if (config.mask) {
13
- return String(config.mask).repeat(input.length);
13
+ const maskChar = typeof config.mask === 'string' ? config.mask : '*';
14
+ return maskChar.repeat(input.length);
14
15
  }
15
16
  if (!isFinal) {
16
17
  return `${chalk.dim('[input is masked]')}${ansiEscapes.cursorHide}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/password",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "engines": {
5
5
  "node": ">=14.18.0"
6
6
  },
@@ -57,11 +57,14 @@
57
57
  "license": "MIT",
58
58
  "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/password/README.md",
59
59
  "dependencies": {
60
- "@inquirer/input": "^1.2.6",
60
+ "@inquirer/input": "^1.2.7",
61
61
  "@inquirer/type": "^1.1.1",
62
62
  "ansi-escapes": "^4.3.2",
63
63
  "chalk": "^4.1.2"
64
64
  },
65
+ "devDependencies": {
66
+ "@inquirer/testing": "^2.1.2"
67
+ },
65
68
  "scripts": {
66
69
  "tsc": "yarn run clean && yarn run tsc:esm && yarn run tsc:cjs",
67
70
  "clean": "rm -rf dist",
@@ -84,5 +87,5 @@
84
87
  }
85
88
  }
86
89
  },
87
- "gitHead": "ab9dd2f301e02d2cc0fec699ce100b174f2b798e"
90
+ "gitHead": "dd31d57ed3b1d0771e24cc34bc72e5bedb63a1d7"
88
91
  }