Skip to content

Commit

Permalink
updates dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Kroeger <[email protected]>
  • Loading branch information
benkroeger committed Sep 26, 2020
1 parent 53a3325 commit dbcd7de
Show file tree
Hide file tree
Showing 7 changed files with 1,890 additions and 729 deletions.
2 changes: 0 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

// node core

// third-party
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/carbon
lts/erbium
2 changes: 0 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

// node core modules

// 3rd party modules
Expand Down
10 changes: 4 additions & 6 deletions lib/redis-cookie-store.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

// node core modules
const util = require('util');

Expand Down Expand Up @@ -48,12 +46,12 @@ const cookiePrefixRegexp = /(.*cookie:[^:]*:)/i;
const pathMatcher = ({ domainKeys, paths, client }, cb) => {
const [firstDomainKey] = domainKeys;
const [, domainPrefix] = firstDomainKey.match(cookiePrefixRegexp); // get domain key prefix e.g. "cookie:www.example.com"
const prefixedPaths = paths.map(path => domainPrefix + path);
const prefixedPaths = paths.map((path) => domainPrefix + path);
const keys = _.intersection(domainKeys, prefixedPaths).sort(
(a, b) => a.length - b.length,
);

const jobs = keys.map(key => next => client.hgetall(key, next));
const jobs = keys.map((key) => (next) => client.hgetall(key, next));

async.parallel(jobs, (err, results) => {
if (err) {
Expand Down Expand Up @@ -86,7 +84,7 @@ RedisCookieStore.prototype.findCookies = function findCookies(
const paths = permutePath(path) || [path];

// prepare jobs to load cookie data from redis for each permuted domain
const jobs = sortedPermutedDomains.map(permutedDomain => next => {
const jobs = sortedPermutedDomains.map((permutedDomain) => (next) => {
const keyName = `${self.getKeyName(permutedDomain)}:*`;

client.keys(keyName, (err, domainKeys) => {
Expand All @@ -110,7 +108,7 @@ RedisCookieStore.prototype.findCookies = function findCookies(
}
cb(
err,
_.values(_.merge(...results)).map(cookieString => {
_.values(_.merge(...results)).map((cookieString) => {
const cookie = Cookie.parse(cookieString);

if (!cookie.domain) {
Expand Down
Loading

0 comments on commit dbcd7de

Please sign in to comment.