Use "getSha1" from HasteFS

Reviewed By: cpojer

Differential Revision: D7721378

fbshipit-source-id: 441666df325c60d94eb6e14b50c3c4cde76b3dfe
This commit is contained in:
Miguel Jimenez Esun 2018-04-21 11:21:00 -07:00 committed by Facebook Github Bot
parent d9f857e966
commit c398cd99a1
2 changed files with 2 additions and 8 deletions

View File

@ -219,14 +219,7 @@ class DependencyGraph extends EventEmitter {
} }
getSha1(filename: string): string { getSha1(filename: string): string {
// $FlowFixMe: TODO T27501330: Use getSha1 from HasteFS. const sha1 = this._hasteFS.getSha1(filename);
const file = this._hasteFS._files[filename];
if (!file) {
throw new ReferenceError(`File ${filename} is not tracked by haste-map`);
}
const sha1 = file[4];
if (!sha1) { if (!sha1) {
throw new ReferenceError(`SHA-1 for file ${filename} is not computed`); throw new ReferenceError(`SHA-1 for file ${filename} is not computed`);

View File

@ -15,5 +15,6 @@ export type HasteFS = {
exists(filePath: string): boolean, exists(filePath: string): boolean,
getAllFiles(): Array<string>, getAllFiles(): Array<string>,
getModuleName(filePath: string): ?string, getModuleName(filePath: string): ?string,
getSha1(string): ?string,
matchFiles(pattern: RegExp | string): Array<string>, matchFiles(pattern: RegExp | string): Array<string>,
}; };