metro-cache
Advanced tools
Comparing version 0.80.5 to 0.80.6
{ | ||
"name": "metro-cache", | ||
"version": "0.80.5", | ||
"version": "0.80.6", | ||
"description": "🚇 Cache layers for Metro.", | ||
@@ -15,7 +15,7 @@ "main": "src/index.js", | ||
"dependencies": { | ||
"metro-core": "0.80.5", | ||
"metro-core": "0.80.6", | ||
"rimraf": "^3.0.2" | ||
}, | ||
"devDependencies": { | ||
"metro-memory-fs": "0.80.5" | ||
"metro-memory-fs": "0.80.6" | ||
}, | ||
@@ -22,0 +22,0 @@ "license": "MIT", |
@@ -1,23 +0,4 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* | ||
* @format | ||
* @oncall react_native | ||
*/ | ||
"use strict"; | ||
const { Logger } = require("metro-core"); | ||
/** | ||
* Main cache class. Receives an array of cache instances, and sequentially | ||
* traverses them to return a previously stored value. It also ensures setting | ||
* the value in all instances. | ||
* | ||
* All get/set operations are logged via Metro's logger. | ||
*/ | ||
class Cache { | ||
@@ -43,4 +24,2 @@ constructor(stores) { | ||
const valueOrPromise = store.get(key); | ||
// $FlowFixMe[method-unbinding] added when improving typing for this parameters | ||
if (valueOrPromise && typeof valueOrPromise.then === "function") { | ||
@@ -85,6 +64,2 @@ value = await valueOrPromise; | ||
} | ||
// Returns true if the current configuration disables the cache, such that | ||
// writing to the cache is a no-op and reading from the cache will always | ||
// return null. | ||
get isDisabled() { | ||
@@ -91,0 +66,0 @@ return this._stores.length === 0; |
@@ -1,12 +0,1 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* | ||
* @format | ||
* @oncall react_native | ||
*/ | ||
"use strict"; | ||
@@ -13,0 +2,0 @@ |
@@ -1,12 +0,1 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* | ||
* @format | ||
* @oncall react_native | ||
*/ | ||
"use strict"; | ||
@@ -19,7 +8,5 @@ | ||
.createHash("md5") | ||
/* $FlowFixMe(>=0.95.0 site=react_native_fb) This comment suppresses an | ||
* error found when Flow v0.95 was deployed. To see the error, delete this | ||
* comment and run Flow. */ .update(JSON.stringify(value, canonicalize)) | ||
.update(JSON.stringify(value, canonicalize)) | ||
.digest("buffer"); | ||
} | ||
module.exports = stableHash; |
@@ -1,11 +0,1 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
* | ||
*/ | ||
"use strict"; | ||
@@ -16,3 +6,2 @@ | ||
const path = require("path"); | ||
// List all files in a directory in Node.js recursively in a synchronous fashion | ||
const walkSync = function (dir, filelist) { | ||
@@ -41,6 +30,2 @@ const files = fs.readdirSync(dir); | ||
} | ||
/** | ||
* A FileStore that cleans itself up in a given interval | ||
*/ | ||
class AutoCleanFileStore extends FileStore { | ||
@@ -51,12 +36,10 @@ constructor(opts) { | ||
}); | ||
this._intervalMs = get(opts.intervalMs, 10 * 60 * 1000); // 10 minutes | ||
this._intervalMs = get(opts.intervalMs, 10 * 60 * 1000); | ||
this._cleanupThresholdMs = get( | ||
opts.cleanupThresholdMs, | ||
3 * 24 * 60 * 60 * 1000 // 3 days | ||
3 * 24 * 60 * 60 * 1000 | ||
); | ||
this._scheduleCleanup(); | ||
} | ||
_scheduleCleanup() { | ||
// $FlowFixMe[method-unbinding] added when improving typing for this parameters | ||
setTimeout(this._doCleanup.bind(this), this._intervalMs); | ||
@@ -63,0 +46,0 @@ } |
@@ -1,11 +0,1 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
* | ||
*/ | ||
"use strict"; | ||
@@ -12,0 +2,0 @@ |
@@ -1,11 +0,1 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
* | ||
*/ | ||
"use strict"; | ||
@@ -12,0 +2,0 @@ |
@@ -1,11 +0,1 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
* | ||
*/ | ||
"use strict"; | ||
@@ -12,0 +2,0 @@ |
@@ -1,11 +0,1 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
* | ||
*/ | ||
"use strict"; | ||
@@ -38,11 +28,8 @@ | ||
if (options.key != null) { | ||
// $FlowFixMe `key` is missing in the Flow definition | ||
agentConfig.key = options.key; | ||
} | ||
if (options.cert != null) { | ||
// $FlowFixMe `cert` is missing in the Flow definition | ||
agentConfig.cert = options.cert; | ||
} | ||
if (options.ca != null) { | ||
// $FlowFixMe `ca` is missing in the Flow definition | ||
agentConfig.ca = options.ca; | ||
@@ -71,6 +58,2 @@ } | ||
}; | ||
/* $FlowFixMe(>=0.101.0 site=react_native_fb) This comment suppresses an | ||
* error found when Flow v0.101 was deployed. To see the error, delete | ||
* this comment and run Flow. */ | ||
const req = this._module.request(options, (res) => { | ||
@@ -129,6 +112,2 @@ const code = res.statusCode; | ||
}; | ||
/* $FlowFixMe(>=0.101.0 site=react_native_fb) This comment suppresses an | ||
* error found when Flow v0.101 was deployed. To see the error, delete | ||
* this comment and run Flow. */ | ||
const req = this._module.request(options, (res) => { | ||
@@ -147,4 +126,2 @@ const code = res.statusCode; | ||
}); | ||
// Consume all the data from the response without processing it. | ||
res.resume(); | ||
@@ -164,6 +141,4 @@ }); | ||
} | ||
clear() { | ||
// Not implemented. | ||
} | ||
clear() {} | ||
} | ||
module.exports = HttpStore; |
@@ -1,11 +0,1 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
* | ||
*/ | ||
"use strict"; | ||
@@ -12,0 +2,0 @@ |
@@ -1,12 +0,1 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* | ||
* @format | ||
* @oncall react_native | ||
*/ | ||
"use strict"; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33947
575
+ Addedmetro-core@0.80.6(transitive)
+ Addedmetro-resolver@0.80.6(transitive)
- Removedmetro-core@0.80.5(transitive)
- Removedmetro-resolver@0.80.5(transitive)
Updatedmetro-core@0.80.6