mirror of
https://github.com/silverstripe/doc.silverstripe.org
synced 2024-06-29 07:59:40 +02:00
13 lines
350 B
TypeScript
13 lines
350 B
TypeScript
|
|
const rewriteAPILink = (link: string): string => {
|
|
const version = 4;
|
|
const match = link.match(/api\:(.*)/);
|
|
if (!match) {
|
|
console.error(`Unable to resolve api link ${link}!`);
|
|
return link;
|
|
}
|
|
|
|
return `https://api.silverstripe.org/search/lookup?q=${match[1]}&version=${version}`;
|
|
};
|
|
|
|
export default rewriteAPILink; |