(value, max = 320)
| 40 | } |
| 41 | |
| 42 | function short(value, max = 320) { |
| 43 | if (value === undefined || value === null) return ""; |
| 44 | const text = typeof value === "string" ? value : JSON.stringify(value); |
| 45 | return text.length > max ? `${text.slice(0, max)}...` : text; |
| 46 | } |
| 47 | |
| 48 | function maskPhone(phone = "") { |
| 49 | return String(phone || "").replace(/^(\d{3})\d{4}(\d{4})$/, "$1****$2"); |
no outgoing calls
no test coverage detected