Skip to content

Commit

Permalink
fix: ensure keyprefix is not undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
stafyniaksacha committed Mar 15, 2022
1 parent c7958fa commit 9134f52
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ class CacheContentTypeConfig {
*/
relatedContentTypeUid = [];

constructor(options) {
if (!options) return;

constructor(options = {}) {
const {
singleType = false,
injectDefaultRoutes = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ class CacheKeysConfig {
*/
useQueryParams = true;

constructor(options) {
if (!options) return;

constructor(options = {}) {
const { useHeaders = [], useQueryParams = true } = options;
this.useHeaders = useHeaders;
this.useQueryParams = useQueryParams;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ class CachePluginStrategy {
*/
keys;

constructor(options) {
if (!options) return;

constructor(options = {}) {
const {
debug = false,
enableEtag = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ class CacheRouteConfig {
*/
hitpass = false;

constructor(options) {
if (!options) return;

constructor(options = {}) {
const {
path,
method = 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CouchbaseCacheProvider extends CacheProvider {
return this.cache.del(key);
}

async keys(prefix) {
async keys(prefix = "") {
return this.cache.keys(`${prefix}.*`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class RedisCacheProvider extends CacheProvider {
return this.cache.del(key);
}

async keys(prefix) {
async keys(prefix = "") {
return this.cache.keys(`${prefix}*`);
}

Expand Down

0 comments on commit 9134f52

Please sign in to comment.