MCPcopy Create free account
hub / github.com/openai/plugins / findRelativeLinks

Function findRelativeLinks

plugins/plugin-eval/src/evaluators/skill.js:23–36  ·  view source on GitHub ↗
(markdown)

Source from the content-addressed store, hash-verified

21}
22
23function findRelativeLinks(markdown) {
24 return [...markdown.matchAll(/\[[^\]]+\]\(([^)]+)\)/g)]
25 .map((match) => match[1])
26 .filter(
27 (target) =>
28 !target.startsWith("http://") &&
29 !target.startsWith("https://") &&
30 !target.startsWith("app://") &&
31 !target.startsWith("plugin://") &&
32 !target.startsWith("rules://") &&
33 !target.startsWith("mailto:") &&
34 !target.startsWith("#"),
35 );
36}
37
38function isHyphenCase(value) {
39 return /^[a-z0-9-]+$/.test(value) && !value.startsWith("-") && !value.endsWith("-") && !value.includes("--");

Callers 1

evaluateSkillFunction · 0.85

Calls 2

filterMethod · 0.80
mapMethod · 0.80

Tested by

no test coverage detected