Skip to content

Commit

Permalink
Add support for array of promises.
Browse files Browse the repository at this point in the history
  • Loading branch information
Asafkbalink committed Jun 10, 2020
1 parent e091b67 commit fea869b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dist/index.js
Expand Up @@ -41,6 +41,8 @@ const redisStore = (...args) => {
return cb(new Error(`"${value}" is not a cacheable value`));
}

value = Array.isArray(value) ? await Promise.all(array) : value;

const ttl = (options.ttl || options.ttl === 0) ? options.ttl : storeArgs.ttl;
const val = JSON.stringify(value) || '"undefined"';

Expand Down

0 comments on commit fea869b

Please sign in to comment.