(purchase, options = {})
| 299 | } |
| 300 | |
| 301 | function isLuckmailPurchasePreserved(purchase, options = {}) { |
| 302 | const normalizedPurchase = normalizeLuckmailPurchase(purchase); |
| 303 | const expectedTagId = Number(options.preserveTagId) || 0; |
| 304 | const expectedTagName = normalizeText(options.preserveTagName || DEFAULT_LUCKMAIL_PRESERVE_TAG_NAME); |
| 305 | |
| 306 | if (expectedTagId > 0 && normalizedPurchase.tag_id === expectedTagId) { |
| 307 | return true; |
| 308 | } |
| 309 | |
| 310 | return Boolean(normalizedPurchase.tag_name && normalizeText(normalizedPurchase.tag_name) === expectedTagName); |
| 311 | } |
| 312 | |
| 313 | function isLuckmailPurchaseReusable(purchase, options = {}) { |
| 314 | const normalizedPurchase = normalizeLuckmailPurchase(purchase); |
no test coverage detected