mirror of https://github.com/abpframework/abp
parent
325c02dfe2
commit
3cc935918d
@ -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