()
| 760 | } |
| 761 | |
| 762 | function getBillingTemplates() { |
| 763 | const raw = storage.get(BILLING_TEMPLATE_STORAGE_KEY, []); |
| 764 | if (!Array.isArray(raw)) return []; |
| 765 | return raw |
| 766 | .filter((item) => item && typeof item === "object" && item.id && item.name && item.data) |
| 767 | .slice(0, BILLING_TEMPLATE_MAX); |
| 768 | } |
| 769 | |
| 770 | function saveBillingTemplates(list) { |
| 771 | const safeList = Array.isArray(list) ? list.slice(0, BILLING_TEMPLATE_MAX) : []; |
no test coverage detected