(content)
| 14 | return `${(bytes / (1024 * 1024)).toFixed(2)} MB`; |
| 15 | } |
| 16 | |
| 17 | function assertPostContentWithinLimit(content) { |
| 18 | const size = getUtf8ByteLength(content); |
| 19 | if (size > POST_CONTENT_MAX_BYTES) { |
| 20 | throw new Error(`Post content cannot exceed ${formatPostContentSize(POST_CONTENT_MAX_BYTES)}.`); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | function normalizePostContent(content) { |
no test coverage detected