@fileverse-dev/formulajs 4.4.20-mod-3 → 4.4.20-mod-5

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/cjs/index.cjs CHANGED
@@ -1441,7 +1441,9 @@ function VLOOKUP(lookup_value, table_array, col_index_num, range_lookup) {
1441
1441
  return result
1442
1442
  }
1443
1443
 
1444
- function XLOOKUP(search_key, lookup_range, result_range, missing_value, isCol,match_mode, search_mode) {
1444
+ function XLOOKUP(search_key, lookup_range, result_range, missing_value, isColV,match_mode, search_mode) {
1445
+ let isCol = isColV === "true" ? true : false;
1446
+
1445
1447
  console.log('XLOOKUP parameters:', { search_key, lookup_range, result_range, missing_value, match_mode, search_mode, isCol });
1446
1448
 
1447
1449
  // Validate required parameters
@@ -1554,7 +1556,6 @@ function performLookup(search_key, lookup_array, result_array, missing_value, ma
1554
1556
  console.log('performLookup called with:', { search_key, lookup_array, result_array, missing_value, match_mode, search_mode, isCol });
1555
1557
 
1556
1558
  let foundIndex = -1;
1557
- const isSingleResultRow = result_array.length === 1;
1558
1559
 
1559
1560
  // Handle different match modes
1560
1561
  switch (match_mode) {
@@ -1576,17 +1577,6 @@ function performLookup(search_key, lookup_array, result_array, missing_value, ma
1576
1577
  // Return missing_value (single value): "yoo"
1577
1578
  return missing_value
1578
1579
  }
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
1580
  // Multiple result rows
1591
1581
  if (isCol) {
1592
1582
  // Return the foundIndex column from all rows: ["e", "r"]
@@ -1596,7 +1586,6 @@ function performLookup(search_key, lookup_array, result_array, missing_value, ma
1596
1586
  // Return the entire matched row: ["e", 3, "s", "hj"]
1597
1587
  return result_array[foundIndex]
1598
1588
  }
1599
- }
1600
1589
  }
1601
1590
 
1602
1591
  function findExactMatch(search_key, lookup_array, search_mode) {
package/lib/esm/index.mjs CHANGED
@@ -1439,7 +1439,9 @@ function VLOOKUP(lookup_value, table_array, col_index_num, range_lookup) {
1439
1439
  return result
1440
1440
  }
1441
1441
 
1442
- function XLOOKUP(search_key, lookup_range, result_range, missing_value, isCol,match_mode, search_mode) {
1442
+ function XLOOKUP(search_key, lookup_range, result_range, missing_value, isColV,match_mode, search_mode) {
1443
+ let isCol = isColV === "true" ? true : false;
1444
+
1443
1445
  console.log('XLOOKUP parameters:', { search_key, lookup_range, result_range, missing_value, match_mode, search_mode, isCol });
1444
1446
 
1445
1447
  // Validate required parameters
@@ -1552,7 +1554,6 @@ function performLookup(search_key, lookup_array, result_array, missing_value, ma
1552
1554
  console.log('performLookup called with:', { search_key, lookup_array, result_array, missing_value, match_mode, search_mode, isCol });
1553
1555
 
1554
1556
  let foundIndex = -1;
1555
- const isSingleResultRow = result_array.length === 1;
1556
1557
 
1557
1558
  // Handle different match modes
1558
1559
  switch (match_mode) {
@@ -1574,17 +1575,6 @@ function performLookup(search_key, lookup_array, result_array, missing_value, ma
1574
1575
  // Return missing_value (single value): "yoo"
1575
1576
  return missing_value
1576
1577
  }
1577
-
1578
- // Return the result
1579
- if (isSingleResultRow) {
1580
- // Single result row - return the entire row regardless of where match was found
1581
- const resultRow = result_array[0];
1582
- if (isCol) {
1583
- return resultRow.map(val => [val])
1584
- } else {
1585
- return resultRow
1586
- }
1587
- } else {
1588
1578
  // Multiple result rows
1589
1579
  if (isCol) {
1590
1580
  // Return the foundIndex column from all rows: ["e", "r"]
@@ -1594,7 +1584,6 @@ function performLookup(search_key, lookup_array, result_array, missing_value, ma
1594
1584
  // Return the entire matched row: ["e", 3, "s", "hj"]
1595
1585
  return result_array[foundIndex]
1596
1586
  }
1597
- }
1598
1587
  }
1599
1588
 
1600
1589
  function findExactMatch(search_key, lookup_array, search_mode) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/formulajs",
3
- "version": "4.4.20-mod-3",
3
+ "version": "4.4.20-mod-5",
4
4
  "description": "JavaScript implementation of most Microsoft Excel formula functions",
5
5
  "author": "Formulajs",
6
6
  "publishConfig": {
@@ -4522,7 +4522,7 @@ export function WORKDAY_INTL(start_date: any, days: any, weekend: any, holidays:
4522
4522
  * @returns
4523
4523
  */
4524
4524
  export function XIRR(values: any, dates: any, guess: any): any;
4525
- export function XLOOKUP(search_key: any, lookup_range: any, result_range: any, missing_value: any, isCol: any, match_mode: any, search_mode: any): any;
4525
+ export function XLOOKUP(search_key: any, lookup_range: any, result_range: any, missing_value: any, isColV: any, match_mode: any, search_mode: any): any;
4526
4526
  /**
4527
4527
  * Returns the net present value for a schedule of cash flows that is not necessarily periodic.
4528
4528
  *
@@ -4522,7 +4522,7 @@ export function WORKDAY_INTL(start_date: any, days: any, weekend: any, holidays:
4522
4522
  * @returns
4523
4523
  */
4524
4524
  export function XIRR(values: any, dates: any, guess: any): any;
4525
- export function XLOOKUP(search_key: any, lookup_range: any, result_range: any, missing_value: any, isCol: any, match_mode: any, search_mode: any): any;
4525
+ export function XLOOKUP(search_key: any, lookup_range: any, result_range: any, missing_value: any, isColV: any, match_mode: any, search_mode: any): any;
4526
4526
  /**
4527
4527
  * Returns the net present value for a schedule of cash flows that is not necessarily periodic.
4528
4528
  *