Skip to content

Commit

Permalink
fix(index): don't use JSON.stringify() to serialize the cache dat…
Browse files Browse the repository at this point in the history
…a (`options.cache`) (#87)
  • Loading branch information
evilebottnawi authored and michael-ciniawsky committed Dec 14, 2017
1 parent bed4d76 commit 0d22741
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ class CompressionPlugin {
return cacache
.get(cacheDir, cacheKey)
.then(
result => JSON.parse(result.data),
result => result.data,
() => Promise
.resolve()
.then(() => this.compress(content))
.then(
data => cacache.put(cacheDir, cacheKey, JSON.stringify(data))
data => cacache.put(cacheDir, cacheKey, data.toString())
.then(() => data),
),
);
Expand Down

0 comments on commit 0d22741

Please sign in to comment.