@sap-ux/fe-mockserver-core
Advanced tools
Comparing version 1.2.18 to 1.2.19
@@ -10,2 +10,5 @@ "use strict"; | ||
const common_1 = require("../data/common"); | ||
function getNumberLength(number) { | ||
return number.toString().length; | ||
} | ||
function isPropertyPathExpression(expression) { | ||
@@ -247,3 +250,3 @@ return (expression === null || expression === void 0 ? void 0 : expression.type) === 'PropertyPath'; | ||
if (property.maxLength) { | ||
const remainingLength = property.maxLength - lineIndex - 2; | ||
const remainingLength = property.maxLength - getNumberLength(lineIndex) - 2; | ||
return `${propertyName.substring(0, remainingLength)}_${lineIndex}`; | ||
@@ -316,2 +319,3 @@ } | ||
const currentMockData = this._mockData || mockData; | ||
const propertyName = property.name; | ||
let highestIndex; | ||
@@ -322,3 +326,3 @@ switch (property.type) { | ||
currentMockData.forEach((mockLine) => { | ||
const mockLineIndex = parseInt(mockLine[property.name], 10); | ||
const mockLineIndex = parseInt(mockLine[propertyName], 10); | ||
highestIndex = Math.max(highestIndex, mockLineIndex); | ||
@@ -335,3 +339,7 @@ }); | ||
} | ||
return `${property.name}_${lineIndex}`; | ||
if (property.maxLength) { | ||
const remainingLength = property.maxLength - getNumberLength(lineIndex); | ||
return `${propertyName.substring(0, remainingLength)}${lineIndex}`; | ||
} | ||
return `${propertyName}_${lineIndex}`; | ||
default: | ||
@@ -338,0 +346,0 @@ return (0, common_1.generateId)(12); |
{ | ||
"name": "@sap-ux/fe-mockserver-core", | ||
"version": "1.2.18", | ||
"version": "1.2.19", | ||
"description": "SAP Fiori OData - Fiori elements mock server core", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
595133
6864