fix(bazel): correct regexp test for self-references in metadata (#29346)

Add a test that catches the mistake, should have had this in the previous change

PR Close #29346
This commit is contained in:
Alex Eagle
2019-03-15 15:39:12 -07:00
committed by Jason Aden
parent 3d5b98631a
commit 9d090cb3db
2 changed files with 3 additions and 1 deletions

View File

@ -415,7 +415,7 @@ export * from '${srcDirRelative(inputPath, typingsFile.replace(/\.d\.tsx?$/, '')
if (metadata.exports) {
// Strip re-exports which are now self-references
metadata.exports =
metadata.exports.filter((e: {from: string}) => !relativePathRegex.test(e.from));
metadata.exports.filter((e: {from: string}) => !e.from.match(relativePathRegex));
}
return JSON.stringify(metadata).replace(relativePathRegex, typingsRelativePath);
}