@sap-ux/project-input-validator 0.6.25 → 0.6.26

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.
@@ -29,9 +29,10 @@ export declare function isDataSourceURI(uri: string): boolean;
29
29
  * @param {string} value - The project name.
30
30
  * @param {string} destinationPath - The project directory.
31
31
  * @param {boolean} isCustomerBase - Whether the layer is customer base.
32
+ * @param {boolean} isCfEnv - Whether the project is in a CF environment.
32
33
  * @returns {string | boolean} If value is valid returns true otherwise error message.
33
34
  */
34
- export declare function validateProjectName(value: string, destinationPath: string, isCustomerBase: boolean): boolean | string;
35
+ export declare function validateProjectName(value: string, destinationPath: string, isCustomerBase: boolean, isCfEnv: boolean): boolean | string;
35
36
  /**
36
37
  * Validates that project name is valid for CUSTOMER_BASE layer.
37
38
  *
@@ -51,9 +51,10 @@ function isDataSourceURI(uri) {
51
51
  * @param {string} value - The project name.
52
52
  * @param {string} destinationPath - The project directory.
53
53
  * @param {boolean} isCustomerBase - Whether the layer is customer base.
54
+ * @param {boolean} isCfEnv - Whether the project is in a CF environment.
54
55
  * @returns {string | boolean} If value is valid returns true otherwise error message.
55
56
  */
56
- function validateProjectName(value, destinationPath, isCustomerBase) {
57
+ function validateProjectName(value, destinationPath, isCustomerBase, isCfEnv) {
57
58
  const validationResult = (0, validators_1.validateEmptyString)(value);
58
59
  if (typeof validationResult === 'string') {
59
60
  return validationResult;
@@ -61,6 +62,9 @@ function validateProjectName(value, destinationPath, isCustomerBase) {
61
62
  if (/[A-Z]/.test(value)) {
62
63
  return (0, i18n_1.t)('adp.projectNameUppercaseError');
63
64
  }
65
+ if (isCfEnv) {
66
+ return validateDuplicateProjectName(value, destinationPath);
67
+ }
64
68
  if (!isCustomerBase) {
65
69
  return validateProjectNameInternal(value);
66
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ux/project-input-validator",
3
- "version": "0.6.25",
3
+ "version": "0.6.26",
4
4
  "description": "Library to validate Fiori project input formats",
5
5
  "repository": {
6
6
  "type": "git",