@fileverse-dev/formulajs 4.4.20-mod-4 → 4.4.20-mod-6
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/browser/formula.js +8 -20
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +1 -14
- package/lib/esm/index.mjs +1 -14
- package/package.json +1 -1
package/lib/cjs/index.cjs
CHANGED
|
@@ -1507,7 +1507,7 @@ result_array.map((row) => {
|
|
|
1507
1507
|
console.log('Normalized arrays:', { lookup_array, result_array });
|
|
1508
1508
|
|
|
1509
1509
|
let res = performLookup(search_key, lookup_array, result_array, missing_value, match_mode, search_mode, isCol);
|
|
1510
|
-
res = isCol ? Array.isArray(res)?res.map((item) => [item.toString()]):res : res;
|
|
1510
|
+
res = isCol ? Array.isArray(res)?res.map((item) => [item.toString()]):res : [res];
|
|
1511
1511
|
return res
|
|
1512
1512
|
}
|
|
1513
1513
|
|
|
@@ -1556,7 +1556,6 @@ function performLookup(search_key, lookup_array, result_array, missing_value, ma
|
|
|
1556
1556
|
console.log('performLookup called with:', { search_key, lookup_array, result_array, missing_value, match_mode, search_mode, isCol });
|
|
1557
1557
|
|
|
1558
1558
|
let foundIndex = -1;
|
|
1559
|
-
const isSingleResultRow = result_array.length === 1;
|
|
1560
1559
|
|
|
1561
1560
|
// Handle different match modes
|
|
1562
1561
|
switch (match_mode) {
|
|
@@ -1578,17 +1577,6 @@ function performLookup(search_key, lookup_array, result_array, missing_value, ma
|
|
|
1578
1577
|
// Return missing_value (single value): "yoo"
|
|
1579
1578
|
return missing_value
|
|
1580
1579
|
}
|
|
1581
|
-
|
|
1582
|
-
// Return the result
|
|
1583
|
-
if (isSingleResultRow) {
|
|
1584
|
-
// Single result row - return the entire row regardless of where match was found
|
|
1585
|
-
const resultRow = result_array[0];
|
|
1586
|
-
if (isCol) {
|
|
1587
|
-
return resultRow.map(val => [val])
|
|
1588
|
-
} else {
|
|
1589
|
-
return resultRow
|
|
1590
|
-
}
|
|
1591
|
-
} else {
|
|
1592
1580
|
// Multiple result rows
|
|
1593
1581
|
if (isCol) {
|
|
1594
1582
|
// Return the foundIndex column from all rows: ["e", "r"]
|
|
@@ -1598,7 +1586,6 @@ function performLookup(search_key, lookup_array, result_array, missing_value, ma
|
|
|
1598
1586
|
// Return the entire matched row: ["e", 3, "s", "hj"]
|
|
1599
1587
|
return result_array[foundIndex]
|
|
1600
1588
|
}
|
|
1601
|
-
}
|
|
1602
1589
|
}
|
|
1603
1590
|
|
|
1604
1591
|
function findExactMatch(search_key, lookup_array, search_mode) {
|
package/lib/esm/index.mjs
CHANGED
|
@@ -1505,7 +1505,7 @@ result_array.map((row) => {
|
|
|
1505
1505
|
console.log('Normalized arrays:', { lookup_array, result_array });
|
|
1506
1506
|
|
|
1507
1507
|
let res = performLookup(search_key, lookup_array, result_array, missing_value, match_mode, search_mode, isCol);
|
|
1508
|
-
res = isCol ? Array.isArray(res)?res.map((item) => [item.toString()]):res : res;
|
|
1508
|
+
res = isCol ? Array.isArray(res)?res.map((item) => [item.toString()]):res : [res];
|
|
1509
1509
|
return res
|
|
1510
1510
|
}
|
|
1511
1511
|
|
|
@@ -1554,7 +1554,6 @@ function performLookup(search_key, lookup_array, result_array, missing_value, ma
|
|
|
1554
1554
|
console.log('performLookup called with:', { search_key, lookup_array, result_array, missing_value, match_mode, search_mode, isCol });
|
|
1555
1555
|
|
|
1556
1556
|
let foundIndex = -1;
|
|
1557
|
-
const isSingleResultRow = result_array.length === 1;
|
|
1558
1557
|
|
|
1559
1558
|
// Handle different match modes
|
|
1560
1559
|
switch (match_mode) {
|
|
@@ -1576,17 +1575,6 @@ function performLookup(search_key, lookup_array, result_array, missing_value, ma
|
|
|
1576
1575
|
// Return missing_value (single value): "yoo"
|
|
1577
1576
|
return missing_value
|
|
1578
1577
|
}
|
|
1579
|
-
|
|
1580
|
-
// Return the result
|
|
1581
|
-
if (isSingleResultRow) {
|
|
1582
|
-
// Single result row - return the entire row regardless of where match was found
|
|
1583
|
-
const resultRow = result_array[0];
|
|
1584
|
-
if (isCol) {
|
|
1585
|
-
return resultRow.map(val => [val])
|
|
1586
|
-
} else {
|
|
1587
|
-
return resultRow
|
|
1588
|
-
}
|
|
1589
|
-
} else {
|
|
1590
1578
|
// Multiple result rows
|
|
1591
1579
|
if (isCol) {
|
|
1592
1580
|
// Return the foundIndex column from all rows: ["e", "r"]
|
|
@@ -1596,7 +1584,6 @@ function performLookup(search_key, lookup_array, result_array, missing_value, ma
|
|
|
1596
1584
|
// Return the entire matched row: ["e", 3, "s", "hj"]
|
|
1597
1585
|
return result_array[foundIndex]
|
|
1598
1586
|
}
|
|
1599
|
-
}
|
|
1600
1587
|
}
|
|
1601
1588
|
|
|
1602
1589
|
function findExactMatch(search_key, lookup_array, search_mode) {
|