diff --git a/packages/strapi-plugin-rest-cache/server/types/CacheContentTypeConfig.js b/packages/strapi-plugin-rest-cache/server/types/CacheContentTypeConfig.js index 0e771eef4..23ac7d185 100644 --- a/packages/strapi-plugin-rest-cache/server/types/CacheContentTypeConfig.js +++ b/packages/strapi-plugin-rest-cache/server/types/CacheContentTypeConfig.js @@ -44,9 +44,7 @@ class CacheContentTypeConfig { */ relatedContentTypeUid = []; - constructor(options) { - if (!options) return; - + constructor(options = {}) { const { singleType = false, injectDefaultRoutes = true, diff --git a/packages/strapi-plugin-rest-cache/server/types/CacheKeysConfig.js b/packages/strapi-plugin-rest-cache/server/types/CacheKeysConfig.js index 5e09b2e07..3123eebc6 100644 --- a/packages/strapi-plugin-rest-cache/server/types/CacheKeysConfig.js +++ b/packages/strapi-plugin-rest-cache/server/types/CacheKeysConfig.js @@ -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; diff --git a/packages/strapi-plugin-rest-cache/server/types/CachePluginStrategy.js b/packages/strapi-plugin-rest-cache/server/types/CachePluginStrategy.js index 3624ba138..3cf47d376 100644 --- a/packages/strapi-plugin-rest-cache/server/types/CachePluginStrategy.js +++ b/packages/strapi-plugin-rest-cache/server/types/CachePluginStrategy.js @@ -32,9 +32,7 @@ class CachePluginStrategy { */ keys; - constructor(options) { - if (!options) return; - + constructor(options = {}) { const { debug = false, enableEtag = false, diff --git a/packages/strapi-plugin-rest-cache/server/types/CacheRouteConfig.js b/packages/strapi-plugin-rest-cache/server/types/CacheRouteConfig.js index 17c02b0d2..915955894 100644 --- a/packages/strapi-plugin-rest-cache/server/types/CacheRouteConfig.js +++ b/packages/strapi-plugin-rest-cache/server/types/CacheRouteConfig.js @@ -33,9 +33,7 @@ class CacheRouteConfig { */ hitpass = false; - constructor(options) { - if (!options) return; - + constructor(options = {}) { const { path, method = 'GET', diff --git a/packages/strapi-provider-rest-cache-couchbase/lib/CouchbaseCacheProvider.js b/packages/strapi-provider-rest-cache-couchbase/lib/CouchbaseCacheProvider.js index bf2cdb56e..d06b5c18a 100644 --- a/packages/strapi-provider-rest-cache-couchbase/lib/CouchbaseCacheProvider.js +++ b/packages/strapi-provider-rest-cache-couchbase/lib/CouchbaseCacheProvider.js @@ -39,7 +39,7 @@ class CouchbaseCacheProvider extends CacheProvider { return this.cache.del(key); } - async keys(prefix) { + async keys(prefix = "") { return this.cache.keys(`${prefix}.*`); } diff --git a/packages/strapi-provider-rest-cache-redis/lib/RedisCacheProvider.js b/packages/strapi-provider-rest-cache-redis/lib/RedisCacheProvider.js index a15f5b6a7..fefa04ef0 100644 --- a/packages/strapi-provider-rest-cache-redis/lib/RedisCacheProvider.js +++ b/packages/strapi-provider-rest-cache-redis/lib/RedisCacheProvider.js @@ -41,7 +41,7 @@ class RedisCacheProvider extends CacheProvider { return this.cache.del(key); } - async keys(prefix) { + async keys(prefix = "") { return this.cache.keys(`${prefix}*`); }