@zeniai/client-epic-state 5.0.66-betaAR4 → 5.0.66-betaAR6

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.
@@ -83,25 +83,27 @@ function getExpenseAutomationTransactionView(state) {
83
83
  // Also include transactionLocalData for transactions that don't exist in transactionState
84
84
  // but have local data (to match original behavior)
85
85
  const filteredTransactionIds = new Set(filteredTransactionViews.map((view) => view.id));
86
- const filteredTransactionLocalData = transactionIds
87
- .map((transactionId) => {
86
+ // `.flatMap` returns `X[]` directly when the callback returns `[]` for the
87
+ // skip case, so we don't need the trailing `.filter((d): d is X => …)` type
88
+ // predicate that the previous `map → filter` pipeline required.
89
+ const filteredTransactionLocalData = transactionIds.flatMap((transactionId) => {
88
90
  const transactionData = transactionReviewLocalDataById[transactionId];
89
91
  if (transactionData == null) {
90
- return null;
92
+ return [];
91
93
  }
92
94
  // Include if transaction is in filtered results, or if transaction doesn't exist in state
93
95
  // (to maintain backward compatibility with tests)
94
96
  const transactionExists = transactions.some((t) => t.id === transactionId);
95
- if (filteredTransactionIds.has(transactionId) ||
96
- !transactionExists) {
97
- return {
98
- transactionId,
99
- transactionReviewLocalData: transactionData.transactionReviewLocalData,
100
- };
97
+ if (filteredTransactionIds.has(transactionId) || !transactionExists) {
98
+ return [
99
+ {
100
+ transactionId,
101
+ transactionReviewLocalData: transactionData.transactionReviewLocalData,
102
+ },
103
+ ];
101
104
  }
102
- return null;
103
- })
104
- .filter((data) => data != null);
105
+ return [];
106
+ });
105
107
  const monthEndFetchState = monthYearPeriodId != null
106
108
  ? (monthEndCloseChecksViewState.monthEndCloseChecksViewByTenantId[currentTenant.tenantId]?.[monthYearPeriodId] ?? { fetchState: 'Not-Started', error: undefined })
107
109
  : { fetchState: 'Not-Started', error: undefined };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.0.66-betaAR4",
3
+ "version": "5.0.66-betaAR6",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",