@inquirer/password 0.0.28-alpha.0 → 1.0.0
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.
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const input_1 = __importDefault(require("@inquirer/input"));
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const password = (config, context) => {
|
|
9
|
+
if (config.transformer) {
|
|
10
|
+
throw new Error('Inquirer password prompt do not support custom transformer function. Use the input prompt instead.');
|
|
11
|
+
}
|
|
12
|
+
return (0, input_1.default)(Object.assign(Object.assign({}, config), { default: undefined, transformer(input, { isFinal }) {
|
|
13
|
+
if (config.mask) {
|
|
14
|
+
return String(config.mask).repeat(input.length);
|
|
15
|
+
}
|
|
16
|
+
if (!isFinal) {
|
|
17
|
+
return chalk_1.default.dim('[input is masked]');
|
|
18
|
+
}
|
|
19
|
+
return '';
|
|
20
|
+
} }), context);
|
|
21
|
+
};
|
|
22
|
+
exports.default = password;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Prompt } from '@inquirer/type';
|
|
2
2
|
import input from '@inquirer/input';
|
|
3
|
-
|
|
3
|
+
type PasswordConfig = Parameters<typeof input>[0] & {
|
|
4
4
|
mask?: boolean | string;
|
|
5
5
|
};
|
|
6
6
|
declare const password: Prompt<string, PasswordConfig>;
|
package/package.json
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inquirer/password",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": ">=14.18.0"
|
|
6
|
+
},
|
|
5
7
|
"description": "Inquirer password prompt",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"typings": "dist/index.d.
|
|
8
|
+
"main": "./dist/cjs/index.js",
|
|
9
|
+
"typings": "./dist/cjs/types/index.d.mts",
|
|
8
10
|
"files": [
|
|
9
|
-
"dist
|
|
11
|
+
"dist/**/*"
|
|
10
12
|
],
|
|
11
|
-
"repository":
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/SBoudrias/Inquirer.js.git"
|
|
16
|
+
},
|
|
12
17
|
"keywords": [
|
|
13
18
|
"answer",
|
|
14
19
|
"answers",
|
|
15
20
|
"ask",
|
|
16
21
|
"base",
|
|
17
22
|
"cli",
|
|
18
|
-
"cli",
|
|
19
23
|
"command",
|
|
20
24
|
"command-line",
|
|
21
25
|
"confirm",
|
|
@@ -53,15 +57,31 @@
|
|
|
53
57
|
"license": "MIT",
|
|
54
58
|
"homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/password/README.md",
|
|
55
59
|
"dependencies": {
|
|
56
|
-
"@inquirer/input": "^
|
|
57
|
-
"@inquirer/type": "^
|
|
58
|
-
"chalk": "^5.
|
|
60
|
+
"@inquirer/input": "^1.0.0",
|
|
61
|
+
"@inquirer/type": "^1.0.0",
|
|
62
|
+
"chalk": "^5.2.0"
|
|
59
63
|
},
|
|
60
64
|
"scripts": {
|
|
61
|
-
"tsc": "tsc"
|
|
65
|
+
"tsc": "yarn run clean && yarn run tsc:esm && yarn run tsc:cjs",
|
|
66
|
+
"clean": "rm -rf dist",
|
|
67
|
+
"tsc:esm": "tsc -p ./tsconfig.esm.json",
|
|
68
|
+
"tsc:cjs": "tsc -p ./tsconfig.cjs.json && yarn run fix-ext",
|
|
69
|
+
"fix-ext": "ts-node ../../tools/rename-ext.ts"
|
|
62
70
|
},
|
|
63
71
|
"publishConfig": {
|
|
64
72
|
"access": "public"
|
|
65
73
|
},
|
|
66
|
-
"
|
|
74
|
+
"exports": {
|
|
75
|
+
".": {
|
|
76
|
+
"import": {
|
|
77
|
+
"types": "./dist/esm/types/index.d.mts",
|
|
78
|
+
"default": "./dist/esm/index.mjs"
|
|
79
|
+
},
|
|
80
|
+
"require": {
|
|
81
|
+
"types": "./dist/cjs/types/index.d.mts",
|
|
82
|
+
"default": "./dist/cjs/index.js"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"gitHead": "e93c4cb14f0c35ebd1efb065776b90f48899b075"
|
|
67
87
|
}
|
|
File without changes
|