mirror of
https://github.com/status-im/react-native.git
synced 2025-01-12 18:44:25 +00:00
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:
parent
c948ae8168
commit
cb3b744d08
@ -169,7 +169,6 @@
|
||||
"glob": "^7.1.1",
|
||||
"graceful-fs": "^4.1.3",
|
||||
"image-size": "^0.3.5",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"inquirer": "^0.12.0",
|
||||
"jest-haste-map": "19.0.0",
|
||||
"joi": "^6.6.1",
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
jest
|
||||
.unmock('stream')
|
||||
.unmock('imurmurhash')
|
||||
.unmock('crypto')
|
||||
.unmock('../../lib/ModuleTransport')
|
||||
.unmock('../');
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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}`},
|
||||
},
|
||||
};
|
||||
|
@ -11,7 +11,7 @@
|
||||
jest
|
||||
.dontMock('absolute-path')
|
||||
.dontMock('json-stable-stringify')
|
||||
.dontMock('imurmurhash')
|
||||
.dontMock('crypto')
|
||||
.dontMock('../lib/replacePatterns')
|
||||
.dontMock('../DependencyGraph/docblock')
|
||||
.dontMock('../Module');
|
||||
|
Loading…
x
Reference in New Issue
Block a user