MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / assertPostContentWithinLimit

Function assertPostContentWithinLimit

src/Data/PostData.js:16–21  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

14 return `${(bytes / (1024 * 1024)).toFixed(2)} MB`;
15}
16
17function 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
24function normalizePostContent(content) {

Callers 2

addModifyPostFunction · 0.85
addCommentFunction · 0.85

Calls 2

getUtf8ByteLengthFunction · 0.85
formatPostContentSizeFunction · 0.85

Tested by

no test coverage detected