Skip to content

Commit

Permalink
refactor(core): bring coverage back up by removing unnecessary ifs
Browse files Browse the repository at this point in the history
  • Loading branch information
wbhob committed Dec 9, 2017
1 parent bd026d4 commit 38dd56b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/core/scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,10 @@ export class DependenciesScanner {
return Reflect.getMetadata(metadata, metatype) || [];
}

public applyNewPathToModule(metatype, prefix: string) {
public applyNewPathToModule(metatype, prefix: string = '/') {
let path = this.reflectMetadata(metatype, metadata.PATH) || '/';
if (path) {
path = join(prefix, path);
}
path = join(prefix, path);

Reflect.defineMetadata(metadata.PATH, path, metatype);
}

Expand All @@ -173,9 +172,7 @@ export class DependenciesScanner {
path = '/';
}

if (path) {
path = join(prefix, path);
}
path = join(prefix, path);
Reflect.defineMetadata(metadata.PATH, path, metatype);
}
}

0 comments on commit 38dd56b

Please sign in to comment.