Skip to content

Commit

Permalink
🐞 fix: 修复 Controller path 为空时 version 不生效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hmydgz committed Jul 26, 2024
1 parent fef8487 commit 926062a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ export namespace NestDecorator {
version: [],
}

if (_node.length === 0) {
obj.path = ['']
} else {
if (_node.length) {
switch (_node[0].kind) {
case ts.SyntaxKind.StringLiteral:
case ts.SyntaxKind.ArrayLiteralExpression: {
Expand All @@ -171,6 +169,8 @@ export namespace NestDecorator {
}
}

if (!obj.path?.length) obj.path = ['']

return obj
}
}
Expand Down

0 comments on commit 926062a

Please sign in to comment.