fix: path generation for search

This commit is contained in:
iCrawl 2023-11-08 19:01:32 +01:00
parent 4a5e9fc1de
commit e5f3f3130e
No known key found for this signature in database
GPG key ID: 1AB888B16355FBB2

View file

@ -54,8 +54,9 @@ export function generatePath(items: readonly ApiItem[], version: string) {
}
}
// eslint-disable-next-line prefer-named-capture-group
return path.replace(/@discordjs\/(.*)\/(.*)?/, `$1/${version}/$2`);
return path.includes('@discordjs/')
? path.replace(/@discordjs\/(.*)\/(.*)?/, `$1/${version}/$2`)
: path.replace(/(.*)\/(.*)?/, `$1/${version}/$2`);
}
export function resolveDocComment(item: ApiDeclaredItem) {