(rawValue = {})
| 170 | } |
| 171 | |
| 172 | function normalizeLuckmailUsedPurchases(rawValue = {}) { |
| 173 | if (!rawValue || typeof rawValue !== 'object' || Array.isArray(rawValue)) { |
| 174 | return {}; |
| 175 | } |
| 176 | |
| 177 | return Object.entries(rawValue).reduce((result, [key, value]) => { |
| 178 | const normalizedKey = normalizeLuckmailPurchaseId(key); |
| 179 | if (!normalizedKey) { |
| 180 | return result; |
| 181 | } |
| 182 | result[normalizedKey] = Boolean(value); |
| 183 | return result; |
| 184 | }, {}); |
| 185 | } |
| 186 | |
| 187 | function isLuckmailPurchaseForProject(purchase, projectCode = DEFAULT_LUCKMAIL_PROJECT_CODE) { |
| 188 | const normalizedPurchase = normalizeLuckmailPurchase(purchase); |
no test coverage detected