|
7 | 7 | */ |
8 | 8 |
|
9 | 9 | import * as glob from 'glob'; |
| 10 | +import * as path from 'path'; |
10 | 11 | import { Container, decorate, injectable } from 'inversify'; |
11 | 12 | import { Types } from '../constants/Types'; |
12 | 13 | import { Core } from './Targets'; |
@@ -164,25 +165,21 @@ class IoC { |
164 | 165 | private getClassOfFileExport(name: string, fileExport: any): any { |
165 | 166 | const fileParts = name.split('.'); |
166 | 167 | let fileClass = fileExport; |
167 | | - fileParts.forEach((part) => { |
168 | | - fileClass = fileClass[part]; |
169 | | - }); |
| 168 | + fileParts.forEach((part) => fileClass = fileClass[part]); |
170 | 169 | return fileClass; |
171 | 170 | } |
172 | 171 |
|
173 | 172 | private getTargetOfFile(name: string, target: any): any { |
174 | 173 | const fileParts = name.split('.'); |
175 | 174 | let fileTarget = target; |
176 | | - fileParts.forEach((part) => { |
177 | | - fileTarget = fileTarget[part]; |
178 | | - }); |
| 175 | + fileParts.forEach((part) => fileTarget = fileTarget[part]); |
179 | 176 | return fileTarget; |
180 | 177 | } |
181 | 178 |
|
182 | 179 | private getBasePath(): string { |
183 | 180 | const baseFolder = __dirname.indexOf('/src/') >= 0 ? '/src/' : '/dist/'; |
184 | 181 | const baseRoot = __dirname.substring(0, __dirname.indexOf(baseFolder)); |
185 | | - return `${baseRoot}${baseFolder}api`; |
| 182 | + return path.join(baseRoot, baseFolder, 'api'); |
186 | 183 | } |
187 | 184 |
|
188 | 185 | private getFiles(path: string, done: (files: any[]) => void): void { |
|
0 commit comments