@fireproof/core 0.7.2-dev.7 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/storage/base.js
CHANGED
@@ -276,12 +276,10 @@ export class Base {
|
|
276
276
|
}
|
277
277
|
carReaderCache = new Map();
|
278
278
|
async getCarReader(carCid) {
|
279
|
-
if (this.carReaderCache.has(carCid)) {
|
280
|
-
|
279
|
+
if (!this.carReaderCache.has(carCid)) {
|
280
|
+
this.carReaderCache.set(carCid, this.getCarReaderImpl(carCid));
|
281
281
|
}
|
282
|
-
|
283
|
-
this.carReaderCache.set(carCid, result);
|
284
|
-
return result;
|
282
|
+
return this.carReaderCache.get(carCid);
|
285
283
|
}
|
286
284
|
async getCarReaderImpl(carCid) {
|
287
285
|
carCid = carCid.toString();
|
package/package.json
CHANGED
package/src/storage/base.js
CHANGED
@@ -295,12 +295,10 @@ export class Base {
|
|
295
295
|
|
296
296
|
carReaderCache = new Map()
|
297
297
|
async getCarReader (carCid) {
|
298
|
-
if (this.carReaderCache.has(carCid)) {
|
299
|
-
|
298
|
+
if (!this.carReaderCache.has(carCid)) {
|
299
|
+
this.carReaderCache.set(carCid, this.getCarReaderImpl(carCid))
|
300
300
|
}
|
301
|
-
|
302
|
-
this.carReaderCache.set(carCid, result)
|
303
|
-
return result
|
301
|
+
return this.carReaderCache.get(carCid)
|
304
302
|
}
|
305
303
|
|
306
304
|
async getCarReaderImpl (carCid) {
|