MCPcopy Index your code
hub / github.com/simstudioai/sim / loadAuthors

Function loadAuthors

apps/sim/lib/blog/registry.ts:19–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17let cachedAuthors: Record<string, any> | null = null
18
19async function loadAuthors(): Promise<Record<string, any>> {
20 if (cachedAuthors) return cachedAuthors
21 await ensureContentDirs()
22 const files = await fs.readdir(AUTHORS_DIR).catch(() => [])
23 const authors: Record<string, any> = {}
24 for (const file of files) {
25 if (!file.endsWith('.json')) continue
26 const raw = await fs.readFile(path.join(AUTHORS_DIR, file), 'utf-8')
27 const json = JSON.parse(raw)
28 const author = AuthorSchema.parse(json)
29 authors[author.id] = author
30 }
31 cachedAuthors = authors
32 return authors
33}
34
35function slugify(text: string): string {
36 return text

Callers 1

scanFrontmattersFunction · 0.85

Calls 4

ensureContentDirsFunction · 0.90
readFileMethod · 0.80
joinMethod · 0.80
parseMethod · 0.80

Tested by

no test coverage detected