From 0d22741d505eaa76d22b22ffd3b63b6063cbe56d Mon Sep 17 00:00:00 2001 From: Evilebot Tnawi Date: Thu, 14 Dec 2017 14:33:36 +0300 Subject: [PATCH] fix(index): don't use `JSON.stringify()` to serialize the `cache` data (`options.cache`) (#87) --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index ef907b1..0e46171 100644 --- a/src/index.js +++ b/src/index.js @@ -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), ), );