




























@@ -16,6 +16,16 @@ import { parseMd } from "../parse.js";
1616import { resolveOcPath, setOcPath } from "../universal.js";
1717import { parseYaml } from "../yaml/parse.js";
181819+function collectMatchedItems(matches: readonly { path: { item?: string } }[]): string[] {
20+const items: string[] = [];
21+for (const match of matches) {
22+if (match.path.item !== undefined) {
23+items.push(match.path.item);
24+}
25+}
26+return items;
27+}
28+1929// ---------- hasWildcard ----------------------------------------------------
20302131describe("hasWildcard", () => {
@@ -699,7 +709,7 @@ describe("findOcPaths — Markdown kind", () => {
699709// The `send-email` item is under the `tools` block. Pin that we
700710// get at least one match (the substrate's md `**` should reach it).
701711expect(out.length).toBeGreaterThanOrEqual(1);
702-const items = out.map((m) => m.path.item).filter((v): v is string => v !== undefined);
712+const items = collectMatchedItems(out);
703713expect(items).toContain("send-email");
704714});
705715});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。