Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async writeToCache(cacheKey: string, contents: Blob, map: ?Blob) {
let contentKey = getContentKey(cacheKey);
await this.options.cache.setStream(contentKey, blobToStream(contents));
if (map != null) {
let mapKey = getMapKey(cacheKey);
await this.options.cache.setStream(mapKey, blobToStream(map));
}
}
}
async writeToCache(cacheKey: string, contents: Blob, map: ?Blob) {
let contentKey = getContentKey(cacheKey);
await this.options.cache.setStream(contentKey, blobToStream(contents));
if (map != null) {
let mapKey = getMapKey(cacheKey);
await this.options.cache.setStream(mapKey, blobToStream(map));
}
}
}
getStream(): Readable {
if (this.value.contentKey != null) {
this.content = this.options.cache.getStream(this.value.contentKey);
}
return blobToStream(this.content);
}