Skip to content

Commit

Permalink
feat: optimize code logic
Browse files Browse the repository at this point in the history
Signed-off-by: suzhou <[email protected]>
  • Loading branch information
SuZhou-Joe committed Mar 23, 2023
1 parent 2a698e3 commit f0d6198
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,8 @@ export class DocLinksService {
} else {
const validDocPathsPattern = /^\d+\.\d+$/;
const parsedBuildVersion = parse(buildVersion);
if (validDocPathsPattern.test(pkgBranch)) {
branch = pkgBranch;
} else if (parsedBuildVersion) {
if (!validDocPathsPattern.test(pkgBranch) && parsedBuildVersion) {
branch = `${parsedBuildVersion.major}.${parsedBuildVersion.minor}`;
} else {
branch = pkgBranch;
}
}
const DOC_LINK_VERSION = branch;
Expand Down

0 comments on commit f0d6198

Please sign in to comment.