packager: remove unused imurmurhash

Summary: This is not used by live code anymore.

Reviewed By: cpojer

Differential Revision: D5029114

fbshipit-source-id: 9ab9f6075407623debfe23bc121cc48ae8903917
This commit is contained in:
Jean Lauliac 2017-05-10 03:44:54 -07:00 committed by Facebook Github Bot
parent 89822280cb
commit 99661854de
4 changed files with 10 additions and 11 deletions

View File

@ -10,7 +10,7 @@
jest
.unmock('stream')
.unmock('imurmurhash')
.unmock('crypto')
.unmock('../../lib/ModuleTransport')
.unmock('../');

View File

@ -9,7 +9,7 @@
'use strict';
const imurmurhash = require('imurmurhash');
const crypto = require('crypto');
const jsonStableStringify = require('json-stable-stringify');
const transformCache = new Map();
@ -23,10 +23,11 @@ const mock = {
};
const transformCacheKeyOf = props =>
props.filePath + '-' + imurmurhash(props.sourceCode)
.hash(props.getTransformCacheKey(props.sourceCode, props.filePath, props.transformOptions))
.hash(jsonStableStringify(props.transformOptions || {}))
.result().toString(16);
props.filePath + '-' + crypto.createHash('md5')
.update(props.sourceCode)
.update(props.getTransformCacheKey(props.sourceCode, props.filePath, props.transformOptions))
.update(jsonStableStringify(props.transformOptions || {}))
.digest('hex');
function writeSync(props) {
transformCache.set(transformCacheKeyOf(props), props.result);

View File

@ -10,14 +10,12 @@
'use strict';
jest
.dontMock('imurmurhash')
.dontMock('json-stable-stringify')
.dontMock('../TransformCache')
.dontMock('left-pad')
.dontMock('lodash/throttle')
.dontMock('crypto');
const imurmurhash = require('imurmurhash');
const crypto = require('crypto');
const jsonStableStringify = require('json-stable-stringify');
@ -73,7 +71,7 @@ describe('TransformCache', () => {
result: {
code: `/* result for ${key} */`,
dependencies: ['foo', `dep of ${key}`],
dependencyOffsets: [12, imurmurhash('dep' + key).result()],
dependencyOffsets: [12, 34],
map: {desc: `source map for ${key}`},
},
};
@ -108,7 +106,7 @@ describe('TransformCache', () => {
result: {
code: `/* result for ${key} */`,
dependencies: ['foo', 'bar'],
dependencyOffsets: [12, imurmurhash('dep' + key).result()],
dependencyOffsets: [12, 34],
map: {desc: `source map for ${key}`},
},
};

View File

@ -11,7 +11,7 @@
jest
.dontMock('absolute-path')
.dontMock('json-stable-stringify')
.dontMock('imurmurhash')
.dontMock('crypto')
.dontMock('../lib/replacePatterns')
.dontMock('../DependencyGraph/docblock')
.dontMock('../Module');