(item = {})
| 100 | } |
| 101 | |
| 102 | function normalizeLuckmailTag(item = {}) { |
| 103 | const safeItem = item && typeof item === 'object' ? item : {}; |
| 104 | return { |
| 105 | id: Number(safeItem.id) || 0, |
| 106 | name: firstNonEmptyString([safeItem.name, safeItem.tag_name]), |
| 107 | remark: firstNonEmptyString([safeItem.remark]), |
| 108 | limit_type: Number(safeItem.limit_type) || 0, |
| 109 | purchase_count: Number(safeItem.purchase_count) || 0, |
| 110 | created_at: firstNonEmptyString([safeItem.created_at]) || null, |
| 111 | }; |
| 112 | } |
| 113 | |
| 114 | function normalizeLuckmailTags(input) { |
| 115 | const list = Array.isArray(input?.list) |
no test coverage detected