@builttocreate/engine-utils 2.10.1-beta.593v2 → 2.10.1-beta.v593.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.
|
@@ -126,16 +126,20 @@ function generateReadableId(parts, type) {
|
|
|
126
126
|
* @param {Array} tableColumns - Array of table column objects
|
|
127
127
|
* @returns {String} - An ID in the format "{tableId}Column{count+1}" (e.g. "table1Column1")
|
|
128
128
|
*/
|
|
129
|
-
function generateReadableTableColumnId(tableId, tableColumns) {
|
|
129
|
+
function generateReadableTableColumnId(tableId, tableColumns, tableColumnIndex) {
|
|
130
130
|
if (!tableId) throw new Error('generateReadableTableColumnId: tableId is required');
|
|
131
131
|
if (!tableColumns || !Array.isArray(tableColumns)) {
|
|
132
132
|
return "".concat(tableId, "Column1");
|
|
133
133
|
}
|
|
134
|
-
|
|
134
|
+
var targetColumn = tableColumns[tableColumnIndex];
|
|
135
135
|
// Filter out undefined and null values from tableColumns
|
|
136
136
|
var validColumns = tableColumns.filter(function (column) {
|
|
137
137
|
return column !== undefined && column !== null;
|
|
138
138
|
});
|
|
139
|
-
var
|
|
140
|
-
|
|
139
|
+
var counts = {};
|
|
140
|
+
var type = targetColumn.type;
|
|
141
|
+
counts[type] = (counts[type] || 0) + 1;
|
|
142
|
+
return "".concat(type).concat(counts[type]);
|
|
143
|
+
// const count = validColumns.length;
|
|
144
|
+
// return `${tableId}Column${count + 1}`;
|
|
141
145
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builttocreate/engine-utils",
|
|
3
|
-
"version": "2.10.1-beta.
|
|
3
|
+
"version": "2.10.1-beta.v593.0",
|
|
4
4
|
"description": "Utility library for common logic shared across web and mobile",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://github.com/zionlabs/engine-utils#readme",
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@babel/cli": "^7.
|
|
33
|
+
"@babel/cli": "^7.27.2",
|
|
34
34
|
"@babel/core": "^7.12.10",
|
|
35
35
|
"@babel/plugin-proposal-class-properties": "^7.12.1",
|
|
36
36
|
"@babel/plugin-transform-regenerator": "^7.12.1",
|