MCPcopy Index your code
hub / github.com/tinyplex/tinybase / splitLeadingImage

Function splitLeadingImage

site/thumbnail.ts:37–50  ·  view source on GitHub ↗
(
  markdown: string | undefined,
)

Source from the content-addressed store, hash-verified

35};
36
37const splitLeadingImage = (
38 markdown: string | undefined,
39): {thumbnail?: Thumbnail; markdown: string} => {
40 const source = markdown ?? '';
41 const trimmed = source.replace(/^\s+/, '');
42 const [firstLine = ''] = trimmed.split('\n');
43 const thumbnail = parseLeadingImage(firstLine.trim());
44 return thumbnail == null
45 ? {markdown: source}
46 : {
47 thumbnail,
48 markdown: removeLeadingWhitespace(trimmed.slice(firstLine.length)),
49 };
50};
51
52const getCommentText = (
53 parts: {text: string}[] | undefined,

Callers 1

extractThumbnailMarkdownFunction · 0.85

Calls 2

parseLeadingImageFunction · 0.85
removeLeadingWhitespaceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…