(value, max = 320)
| 44 | } |
| 45 | |
| 46 | function short(value, max = 320) { |
| 47 | if (value === undefined || value === null) return ""; |
| 48 | const text = typeof value === "string" ? value : JSON.stringify(value); |
| 49 | return text.length > max ? `${text.slice(0, max)}...` : text; |
| 50 | } |
| 51 | |
| 52 | function md5(value) { |
| 53 | return crypto.createHash("md5").update(String(value)).digest("hex"); |