MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / idsOf

Function idsOf

apps/docs/scripts/check-fragments.mjs:48–62  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

46const idCache = new Map();
47
48function idsOf(file) {
49 if (!idCache.has(file)) {
50 const ids = new Set();
51
52 for (const match of readFileSync(file, "utf8").matchAll(
53 /\bid="([^"]+)"/gu
54 )) {
55 ids.add(match[1]);
56 }
57
58 idCache.set(file, ids);
59 }
60
61 return idCache.get(file);
62}
63
64const errors = [];
65

Callers 1

Calls 3

hasMethod · 0.45
setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected