@sap-ux/ui5-application-inquirer 0.2.5 → 0.2.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.
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hidePrompts = exports.extendWithOptions = exports.withCondition = exports.isVersionIncluded = exports.defaultAppName = exports.appPathExists = void 0;
4
+ const inquirer_common_1 = require("@sap-ux/inquirer-common");
4
5
  const fs_1 = require("fs");
5
6
  const path_1 = require("path");
6
7
  const semver_1 = require("semver");
@@ -106,24 +107,6 @@ function extendValidate(question, validateFunc) {
106
107
  return typeof validate === 'function' ? validate(value, previousAnswers) : true;
107
108
  };
108
109
  }
109
- /**
110
- * Extends an additionalMessages function.
111
- *
112
- * @param question - the question to which the validate function will be applied
113
- * @param addMsgFunc - the additional messages function which will be applied to the question
114
- * @returns the extended additional messages function
115
- */
116
- function extendAdditionalMessages(question, addMsgFunc) {
117
- const addMsgs = question.additionalMessages;
118
- return (value, previousAnswers) => {
119
- const extMsg = addMsgFunc(value, previousAnswers);
120
- if (extMsg) {
121
- return extMsg; // Extended prompt message is returned first
122
- }
123
- // Defer to the original function if a valid message was not returned from the extended version
124
- return typeof addMsgs === 'function' ? addMsgs(value, previousAnswers) : undefined;
125
- };
126
- }
127
110
  /**
128
111
  * Extend the existing prompt property function with the one specified in prompt options or add as new.
129
112
  *
@@ -138,7 +121,7 @@ function applyExtensionFunction(question, promptOption, funcName) {
138
121
  extendedFunc = extendValidate(question, promptOption.validate);
139
122
  }
140
123
  if (funcName === 'additionalMessages' && promptOption.additionalMessages) {
141
- extendedFunc = extendAdditionalMessages(question, promptOption.additionalMessages);
124
+ extendedFunc = (0, inquirer_common_1.extendAdditionalMessages)(question, promptOption.additionalMessages);
142
125
  }
143
126
  question = Object.assign(question, { [funcName]: extendedFunc });
144
127
  return question;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/ui5-application-inquirer",
3
3
  "description": "Prompts module that can prompt users for inputs required for UI5 application writing",
4
- "version": "0.2.5",
4
+ "version": "0.2.7",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -23,8 +23,8 @@
23
23
  "inquirer-autocomplete-prompt": "2.0.1",
24
24
  "lodash": "4.17.21",
25
25
  "semver": "7.5.4",
26
- "@sap-ux/inquirer-common": "0.2.0",
27
- "@sap-ux/project-access": "1.19.1",
26
+ "@sap-ux/inquirer-common": "0.2.1",
27
+ "@sap-ux/project-access": "1.19.2",
28
28
  "@sap-ux/project-input-validator": "0.2.3",
29
29
  "@sap-ux/ui5-info": "0.3.2"
30
30
  },
@@ -35,7 +35,7 @@
35
35
  "@types/lodash": "4.14.202",
36
36
  "@types/semver": "7.5.4",
37
37
  "inquirer": "8.2.6",
38
- "@sap-ux/cap-config-writer": "0.2.21"
38
+ "@sap-ux/cap-config-writer": "0.2.22"
39
39
  },
40
40
  "engines": {
41
41
  "node": ">=18.x"