MCPcopy Index your code
hub / github.com/itwanger/toBeBetterJavaer / collectMarkdownSlugs

Function collectMarkdownSlugs

scripts/sync-sidebar.js:223–236  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

221}
222
223function collectMarkdownSlugs(dir) {
224 return fs
225 .readdirSync(dir, { withFileTypes: true })
226 .filter((entry) => entry.isFile() && entry.name.endsWith(".md"))
227 .map((entry) => {
228 const basename = entry.name.slice(0, -".md".length);
229 return {
230 slug: basename,
231 entry: basename === "readme" ? "readme.md" : basename,
232 };
233 })
234 .filter((file) => file.slug.length > 0)
235 .sort((a, b) => a.slug.localeCompare(b.slug, "en"));
236}
237
238function collectRefs(block) {
239 const refs = [];

Callers 1

syncTargetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected