MCPcopy Index your code
hub / github.com/QLHazyCoder/FlowPilot / normalizeLuckmailPurchaseListPage

Function normalizeLuckmailPurchaseListPage

luckmail-utils.js:150–162  ·  view source on GitHub ↗
(result = {})

Source from the content-addressed store, hash-verified

148 }
149
150 function normalizeLuckmailPurchaseListPage(result = {}) {
151 const safeResult = result && typeof result === 'object' ? result : {};
152 const list = Array.isArray(safeResult.list)
153 ? safeResult.list
154 : (Array.isArray(safeResult.purchases) ? safeResult.purchases : []);
155 const total = Number(safeResult.total);
156 return {
157 list: list.map((item) => normalizeLuckmailPurchase(item)),
158 total: Number.isFinite(total) && total >= 0 ? total : 0,
159 page: Math.max(1, Number(safeResult.page) || 1),
160 page_size: Math.max(1, Number(safeResult.page_size || safeResult.pageSize) || list.length || 1),
161 };
162 }
163
164 function normalizeLuckmailPurchaseId(value) {
165 const numeric = Number(value);

Callers 4

getPurchasesFunction · 0.85
getAllLuckmailPurchasesFunction · 0.85

Calls 1

Tested by

no test coverage detected