mirror of https://github.com/abpframework/abp.git
2 changed files with 16 additions and 0 deletions
@ -0,0 +1,15 @@ |
|||||
|
export function parseNamespace(solution: string, type: string) { |
||||
|
let namespace = type |
||||
|
.split('.') |
||||
|
.slice(0, -1) |
||||
|
.join('.'); |
||||
|
|
||||
|
solution.split('.').reduceRight((acc, part) => { |
||||
|
acc = part + '.' + acc; |
||||
|
const regex = new RegExp('^' + acc + '(Controllers.)?'); |
||||
|
namespace = namespace.replace(regex, ''); |
||||
|
return acc; |
||||
|
}, ''); |
||||
|
|
||||
|
return namespace; |
||||
|
} |
||||
Loading…
Reference in new issue