Skip to content

Commit 00ad6ba

Browse files
chore: Remove commented code and improve variables names
1 parent 6461ac3 commit 00ad6ba

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

lib/services/project-data-service.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ export class ProjectDataService implements IProjectDataService {
106106
const basePath = hasMigrated ? path.join(pathToAndroidDir, SRC_DIR, MAIN_DIR, RESOURCES_DIR) : pathToAndroidDir;
107107

108108
const currentStructure = this.$fs.enumerateFilesInDirectorySync(basePath);
109-
// , (file: string, stat: IFsStats) => {
110-
// return stat.isDirectory() || file.indexOf("drawable") !== -1;
111-
// });
112-
113109
const content = this.getImageDefinitions().android;
114110

115111
return {
@@ -167,20 +163,20 @@ export class ProjectDataService implements IProjectDataService {
167163
return content;
168164
}
169165

170-
private getAndroidAssetSubGroup(input: any, realPaths: string[]): IAssetSubGroup {
166+
private getAndroidAssetSubGroup(assetItems: IAssetItem[], realPaths: string[]): IAssetSubGroup {
171167
const assetSubGroup: IAssetSubGroup = {
172168
images: <any>[]
173169
};
174170

175171
const normalizedPaths = _.map(realPaths, p => path.normalize(p));
176-
_.each(input, image => {
177-
_.find(normalizedPaths, currentNormalizedPath => {
178-
const imagePath = path.join(image.directory, image.filename);
172+
_.each(assetItems, assetItem => {
173+
_.each(normalizedPaths, currentNormalizedPath => {
174+
const imagePath = path.join(assetItem.directory, assetItem.filename);
179175
if (currentNormalizedPath.indexOf(path.normalize(imagePath)) !== -1) {
180-
image.path = currentNormalizedPath;
181-
image.size = `${image.width}${AssetConstants.sizeDelimiter}${image.height}`;
182-
assetSubGroup.images.push(image);
183-
return true;
176+
assetItem.path = currentNormalizedPath;
177+
assetItem.size = `${assetItem.width}${AssetConstants.sizeDelimiter}${assetItem.height}`;
178+
assetSubGroup.images.push(assetItem);
179+
return false;
184180
}
185181
});
186182
});

0 commit comments

Comments
 (0)