microlinkhq / keyvhq

Simple key-value storage with support for multiple backends.

Home Page:https://keyvhq.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem using '@keyv/compress-gzip' with redis

cmartin81 opened this issue · comments

Just tried adding '@keyv/compress-gzip' to my keyv instance.

import Keyv from 'keyv';
const KeyvGzip = require('@keyv/compress-gzip');
const klineCache = new Keyv('redis://localhost:6379', { compression: new KeyvGzip()});

When trying to fetch an object I know that is not in cache I get this error:

return JSON.parse(s, function (key, value) {
              ^
SyntaxError: "undefined" is not valid JSON

Should compress-gzip handle undefined objects?