MCPcopy
hub / github.com/PatrickJS/awesome-cursorrules / toLocalTarget

Function toLocalTarget

scripts/check-awesome-list.mjs:185–201  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

183}
184
185function toLocalTarget(target) {
186 const cleanTarget = decodeURIComponent(target.replace(/^<|>$/g, ""));
187
188 if (cleanTarget.startsWith(selfRepositoryBlobPrefix)) {
189 return cleanTarget.slice(selfRepositoryBlobPrefix.length);
190 }
191
192 if (cleanTarget.startsWith(selfRepositoryRawPrefix)) {
193 return cleanTarget.slice(selfRepositoryRawPrefix.length);
194 }
195
196 if (/^(https?:|mailto:|#)/i.test(cleanTarget)) {
197 return null;
198 }
199
200 return cleanTarget;
201}

Callers 1

checkRuleLinksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected