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

Function isDescriptionComplete

apps/docs/scripts/docs-catalog-lib.mjs:247–265  ·  view source on GitHub ↗
(description)

Source from the content-addressed store, hash-verified

245]);
246
247export function isDescriptionComplete(description) {
248 const trimmed = description.trim();
249
250 if (trimmed === "") {
251 return true;
252 }
253
254 if (/[,;:]$/u.test(trimmed)) {
255 return false;
256 }
257
258 const lastWord = trimmed
259 .split(/\s+/u)
260 .at(-1)
261 ?.replace(/[^\p{L}\p{N}-]/gu, "")
262 .toLowerCase();
263
264 return lastWord === undefined || !DANGLING_TAIL.has(lastWord);
265}
266
267function assertCatalogDescriptionsComplete(catalog) {
268 const bad = [];

Callers 1

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected