@wocker/utils 1.0.2 → 1.0.4
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/lib/promptConfig.js +6 -10
- package/lib/promptGroup.js +1 -1
- package/package.json +3 -3
package/lib/promptConfig.js
CHANGED
|
@@ -25,7 +25,7 @@ const normalizeOptions_1 = require("./normalizeOptions");
|
|
|
25
25
|
const promptConfirm_1 = require("./promptConfirm");
|
|
26
26
|
const promptSelect_1 = require("./promptSelect");
|
|
27
27
|
const promptText_1 = require("./promptText");
|
|
28
|
-
const promptConfig = (
|
|
28
|
+
const promptConfig = (options_1, ...args_1) => __awaiter(void 0, [options_1, ...args_1], void 0, function* (options, values = {}) {
|
|
29
29
|
for (const key in options) {
|
|
30
30
|
const params = options[key];
|
|
31
31
|
switch (params.type) {
|
|
@@ -37,15 +37,11 @@ const promptConfig = (options, values = {}) => __awaiter(void 0, void 0, void 0,
|
|
|
37
37
|
}
|
|
38
38
|
case "boolean": {
|
|
39
39
|
const { type } = params, rest = __rest(params, ["type"]);
|
|
40
|
-
|
|
41
|
-
? values[key]
|
|
42
|
-
:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
else if (key in values) {
|
|
47
|
-
delete values[key];
|
|
48
|
-
}
|
|
40
|
+
values[key] = yield (0, promptConfirm_1.promptConfirm)(Object.assign(Object.assign({}, rest), { default: typeof values[key] === "boolean"
|
|
41
|
+
? values[key]
|
|
42
|
+
: typeof values[key] !== "undefined"
|
|
43
|
+
? values[key] === "true"
|
|
44
|
+
: params.default }));
|
|
49
45
|
break;
|
|
50
46
|
}
|
|
51
47
|
case "select": {
|
package/lib/promptGroup.js
CHANGED
|
@@ -24,7 +24,7 @@ exports.promptGroup = void 0;
|
|
|
24
24
|
const promptConfirm_1 = require("./promptConfirm");
|
|
25
25
|
const promptSelect_1 = require("./promptSelect");
|
|
26
26
|
const promptText_1 = require("./promptText");
|
|
27
|
-
const promptGroup = (
|
|
27
|
+
const promptGroup = (options_1, ...args_1) => __awaiter(void 0, [options_1, ...args_1], void 0, function* (options, values = {}) {
|
|
28
28
|
const res = {};
|
|
29
29
|
for (const key in options) {
|
|
30
30
|
const params = options[key];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wocker/utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"author": "Kris Papercut <krispcut@gmail.com>",
|
|
5
5
|
"description": "Utils for @wocker",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"keywords": [
|
|
10
10
|
"wocker"
|
|
11
11
|
],
|
|
12
|
-
"homepage": "https://github.
|
|
12
|
+
"homepage": "https://kearisp.github.io/wocker",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git+https://github.com/kearisp/wocker-utils.git"
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/inquirer": "^7.3.3",
|
|
31
31
|
"jest": "^29.7.0",
|
|
32
|
-
"typescript": "^5.
|
|
32
|
+
"typescript": "^5.4.5"
|
|
33
33
|
}
|
|
34
34
|
}
|