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

Function normalizeLuckmailTag

luckmail-utils.js:102–112  ·  view source on GitHub ↗
(item = {})

Source from the content-addressed store, hash-verified

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)

Callers 1

normalizeLuckmailTagsFunction · 0.85

Calls 1

firstNonEmptyStringFunction · 0.70

Tested by

no test coverage detected