energyhub-events
Advanced tools
Comparing version 0.1.0-alpha to 0.1.0-alpha.0
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -26,3 +26,3 @@ Object.defineProperty(exports, "__esModule", { | ||
_createClass(CacheDriver, [{ | ||
key: "checksum", | ||
key: 'checksum', | ||
value: function checksum() { | ||
@@ -38,11 +38,19 @@ var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (err, md5) {}; | ||
}, { | ||
key: "stream", | ||
key: 'stream', | ||
value: function stream() { | ||
if (!this.enabled) return this.driver.stream(); | ||
if (this.cache.has(this.key)) { | ||
return this.cache.get(this.key); | ||
var cache = this.cache, | ||
driver = this.driver, | ||
key = this.key; | ||
if (cache.has(key)) { | ||
return cache.get(key); | ||
} else { | ||
var innerStream = this.driver.stream(); | ||
this.cache.set(this.key, innerStream); | ||
var innerStream = driver.stream(); | ||
cache.set(key, innerStream); | ||
innerStream.on('error', function () { | ||
cache.remove(key); | ||
}); | ||
return innerStream; | ||
@@ -49,0 +57,0 @@ } |
@@ -39,3 +39,3 @@ { | ||
}, | ||
"version": "0.1.0-alpha", | ||
"version": "0.1.0-alpha.0", | ||
"devDependencies": { | ||
@@ -42,0 +42,0 @@ "babel-core": "^6.26.3", |
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
40643
943