dobi-cache-2
Advanced tools
Comparing version 4.1.5 to 4.1.6
@@ -88,3 +88,2 @@ var __assign = (this && this.__assign) || function () { | ||
// set config.query | ||
console.log({ query: params.query }); | ||
if (params.query) { | ||
@@ -138,8 +137,12 @@ if (Array.isArray(params.query)) { | ||
if (query.includes('*')) { | ||
key = protocol + "://" + hostname + originalUrl; | ||
var keyQuery = Object.keys(requestQuery).sort().reduce(function (obj, key) { | ||
var _a; | ||
return (__assign(__assign({}, obj), (_a = {}, _a[key] = requestQuery[key], _a))); | ||
}, {}); | ||
key = protocol + "://" + hostname + path + "?" + stringify(keyQuery); | ||
} | ||
else if (query.length) { | ||
var keyQuery = query.sort().reduce(function (obj, field) { | ||
var keyQuery = query.sort().reduce(function (obj, key) { | ||
var _a; | ||
return (__assign(__assign({}, obj), (requestQuery[field] ? (_a = {}, _a[field] = requestQuery[field], _a) : null))); | ||
return (__assign(__assign({}, obj), (requestQuery[key] ? (_a = {}, _a[key] = requestQuery[key], _a) : null))); | ||
}, {}); | ||
@@ -146,0 +149,0 @@ if (Object.keys(keyQuery).length) { |
@@ -40,3 +40,3 @@ { | ||
}, | ||
"version": "4.1.5", | ||
"version": "4.1.6", | ||
"devDependencies": { | ||
@@ -43,0 +43,0 @@ "@babel/core": "^7.0.0-rc.1", |
@@ -114,3 +114,2 @@ import { stringify } from 'querystring'; | ||
hostname, | ||
originalUrl, | ||
path, | ||
@@ -123,3 +122,7 @@ protocol, | ||
if (query.includes('*')) { | ||
key = `${protocol}://${hostname}${originalUrl}` | ||
const keyQuery = Object.keys(requestQuery).sort().reduce<Record<string, string>>((obj, field) => ({ | ||
...obj, | ||
[field]: requestQuery[field], | ||
}), {}); | ||
key = `${protocol}://${hostname}${path}?${stringify(keyQuery)}` | ||
} else if (query.length) { | ||
@@ -126,0 +129,0 @@ const keyQuery = query.sort().reduce<Record<string, any>>((obj, field) => ({ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
242590
1019