mirror of https://github.com/status-im/metro.git
Use "getSha1" from HasteFS
Reviewed By: cpojer Differential Revision: D7721378 fbshipit-source-id: 441666df325c60d94eb6e14b50c3c4cde76b3dfe
This commit is contained in:
parent
d9f857e966
commit
c398cd99a1
|
@ -219,14 +219,7 @@ class DependencyGraph extends EventEmitter {
|
|||
}
|
||||
|
||||
getSha1(filename: string): string {
|
||||
// $FlowFixMe: TODO T27501330: Use getSha1 from HasteFS.
|
||||
const file = this._hasteFS._files[filename];
|
||||
|
||||
if (!file) {
|
||||
throw new ReferenceError(`File ${filename} is not tracked by haste-map`);
|
||||
}
|
||||
|
||||
const sha1 = file[4];
|
||||
const sha1 = this._hasteFS.getSha1(filename);
|
||||
|
||||
if (!sha1) {
|
||||
throw new ReferenceError(`SHA-1 for file ${filename} is not computed`);
|
||||
|
|
|
@ -15,5 +15,6 @@ export type HasteFS = {
|
|||
exists(filePath: string): boolean,
|
||||
getAllFiles(): Array<string>,
|
||||
getModuleName(filePath: string): ?string,
|
||||
getSha1(string): ?string,
|
||||
matchFiles(pattern: RegExp | string): Array<string>,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue