Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0d22741

Browse files
evilebottnawimichael-ciniawsky
authored andcommitted
fix(index): don't use JSON.stringify() to serialize the cache data (options.cache) (#87)
1 parent bed4d76 commit 0d22741

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ class CompressionPlugin {
101101
return cacache
102102
.get(cacheDir, cacheKey)
103103
.then(
104-
result => JSON.parse(result.data),
104+
result => result.data,
105105
() => Promise
106106
.resolve()
107107
.then(() => this.compress(content))
108108
.then(
109-
data => cacache.put(cacheDir, cacheKey, JSON.stringify(data))
109+
data => cacache.put(cacheDir, cacheKey, data.toString())
110110
.then(() => data),
111111
),
112112
);

0 commit comments

Comments
 (0)