metro-cache
Advanced tools
Comparing version 0.34.0 to 0.35.0
{ | ||
"version": "0.34.0", | ||
"version": "0.35.0", | ||
"name": "metro-cache", | ||
@@ -15,7 +15,10 @@ "description": "🚇 Cache layers for Metro", | ||
"dependencies": { | ||
"jest-serializer": "22.4.3", | ||
"metro-core": "0.34.0", | ||
"jest-serializer": "23.0.0-beta.1", | ||
"metro-core": "0.35.0", | ||
"mkdirp": "^0.5.1", | ||
"rimraf": "^2.5.4" | ||
}, | ||
"devDependencies": { | ||
"metro-memory-fs": "0.35.0" | ||
} | ||
} |
@@ -35,5 +35,5 @@ /** | ||
.update(JSON.stringify(value, canonicalize)) | ||
.digest(); | ||
.digest('buffer'); | ||
} | ||
module.exports = stableHash; |
@@ -24,5 +24,2 @@ /** | ||
const JOINER_DATA = '\0\0'; | ||
const JOINER_LIST = '\0'; | ||
class FileStore { | ||
@@ -38,10 +35,3 @@ _root: string; | ||
try { | ||
const data = fs.readFileSync(this._getFilePath(key), 'utf8'); | ||
const [code, dependencies, map] = data.split(JOINER_DATA); | ||
return { | ||
code, | ||
dependencies: dependencies ? dependencies.split(JOINER_LIST) : [], | ||
map: JSON.parse(map), | ||
}; | ||
return JSON.parse(fs.readFileSync(this._getFilePath(key), 'utf8')); | ||
} catch (err) { | ||
@@ -57,9 +47,3 @@ if (err.code === 'ENOENT') { | ||
set(key: Buffer, value: TransformedCode): void { | ||
const data = [ | ||
value.code, | ||
value.dependencies.join(JOINER_LIST), | ||
JSON.stringify(value.map), | ||
].join(JOINER_DATA); | ||
fs.writeFileSync(this._getFilePath(key), data); | ||
fs.writeFileSync(this._getFilePath(key), JSON.stringify(value)); | ||
} | ||
@@ -66,0 +50,0 @@ |
@@ -114,2 +114,6 @@ /** | ||
req.on('error', err => { | ||
reject(err); | ||
}); | ||
req.end(); | ||
@@ -116,0 +120,0 @@ }); |
@@ -35,5 +35,5 @@ /** | ||
update(JSON.stringify(value, canonicalize)). | ||
digest(); | ||
digest('buffer'); | ||
} | ||
module.exports = stableHash; |
@@ -11,3 +11,3 @@ /** | ||
'use strict';var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}(); | ||
'use strict'; | ||
@@ -25,5 +25,2 @@ const fs = require('fs'); | ||
const JOINER_DATA = '\0\0'; | ||
const JOINER_LIST = '\0'; | ||
class FileStore { | ||
@@ -39,10 +36,3 @@ | ||
try { | ||
const data = fs.readFileSync(this._getFilePath(key), 'utf8');var _data$split = | ||
data.split(JOINER_DATA),_data$split2 = _slicedToArray(_data$split, 3);const code = _data$split2[0],dependencies = _data$split2[1],map = _data$split2[2]; | ||
return { | ||
code, | ||
dependencies: dependencies ? dependencies.split(JOINER_LIST) : [], | ||
map: JSON.parse(map) }; | ||
return JSON.parse(fs.readFileSync(this._getFilePath(key), 'utf8')); | ||
} catch (err) { | ||
@@ -58,9 +48,3 @@ if (err.code === 'ENOENT') { | ||
set(key, value) { | ||
const data = [ | ||
value.code, | ||
value.dependencies.join(JOINER_LIST), | ||
JSON.stringify(value.map)]. | ||
join(JOINER_DATA); | ||
fs.writeFileSync(this._getFilePath(key), data); | ||
fs.writeFileSync(this._getFilePath(key), JSON.stringify(value)); | ||
} | ||
@@ -67,0 +51,0 @@ |
@@ -114,2 +114,6 @@ /** | ||
req.on('error', err => { | ||
reject(err); | ||
}); | ||
req.end(); | ||
@@ -116,0 +120,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
23
1021
42287
1
3
+ Addedjest-haste-map@23.0.0-beta.1(transitive)
+ Addedjest-serializer@23.0.0-beta.1(transitive)
+ Addedmetro-core@0.35.0(transitive)
+ Addedmetro-resolver@0.35.0(transitive)
- Removedjest-haste-map@23.0.0-alpha.4(transitive)
- Removedjest-serializer@22.4.3(transitive)
- Removedmetro-core@0.34.0(transitive)
- Removedmetro-resolver@0.34.0(transitive)
Updatedmetro-core@0.35.0