MCPcopy Index your code
hub / github.com/OpenSIST/OpenSIST.github.io / normalizePostContent

Function normalizePostContent

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

Source from the content-addressed store, hash-verified

36}
37
38function normalizePostContent(content) {
39 if (!content) {
40 return content;
41 }
42 return {
43 ...content,
44 id: content.id?.toString(),
45 parentId: (content.parentId ?? content.parent_id)?.toString(),
46 tags: normalizeTags(content.tags),
47 like_count: content.like_count ?? 0,
48 liked: Boolean(content.liked),
49 is_deleted: Boolean(content.is_deleted),
50 };
51}
52
53export async function getPosts(query = {}) {
54 const postsResult = await apiJson(LIST_POSTS_API);

Callers 1

getPostThreadFunction · 0.85

Calls 1

normalizeTagsFunction · 0.85

Tested by

no test coverage detected