fix(metadata): treat empty array of metadata like absent file (#10610)

This commit is contained in:
Alex Eagle
2016-08-10 11:52:56 -07:00
committed by vikerman
parent aff1bc9f2d
commit 9a11ec2624
2 changed files with 10 additions and 2 deletions

View File

@ -238,7 +238,8 @@ export class ReflectorHost implements StaticReflectorHost, ImportGenerator {
if (DTS.test(filePath)) {
const metadataPath = filePath.replace(DTS, '.metadata.json');
if (this.context.fileExists(metadataPath)) {
return this.readMetadata(metadataPath);
const metadata = this.readMetadata(metadataPath);
return (Array.isArray(metadata) && metadata.length == 0) ? undefined : metadata;
}
} else {
const sf = this.program.getSourceFile(filePath);