mirror of https://github.com/abpframework/abp.git
3 changed files with 13 additions and 10 deletions
@ -0,0 +1,11 @@ |
|||||
|
import { Import } from '../models'; |
||||
|
|
||||
|
export function sortImports(imports: Import[]) { |
||||
|
imports.sort((a, b) => |
||||
|
removeRelative(a) > removeRelative(b) ? 1 : a.keyword > b.keyword ? 1 : -1, |
||||
|
); |
||||
|
} |
||||
|
|
||||
|
export function removeRelative(importDef: Import) { |
||||
|
return importDef.path.replace(/\.\.\//g, ''); |
||||
|
} |
||||
Loading…
Reference in new issue