How to use the permuteDomain function from tough-cookie

Find comprehensive JavaScript tough-cookie.permuteDomain code examples handpicked from public code repositorys.

2
3
4
5
6
7
8
9
10
11
var fs = require('fs');
var UTIL = require('util');
var Q = require('q');
var TOUGH = require('tough-cookie');
var canonicalDomain = TOUGH.canonicalDomain;
var permuteDomain = TOUGH.permuteDomain;
var permutePath = TOUGH.permutePath;
var LOCKFILE = require('lockfile');

function isString(str) {
fork icon8
star icon4
watch icon0

+ 3 other calls in file

116
117
118
119
120
121
122
123
124
125
      }
    })
  }
}

const domains = permuteDomain(domain, allowSpecialUseDomain) || [domain]
const idx = this.idx
domains.forEach(curDomain => {
  const domainIndex = idx[curDomain]
  if (!domainIndex) {
fork icon12
star icon20
watch icon2

+ 3 other calls in file

72
73
74
75
76
77
78
79
80
81
if (!domain) {
  cb(null, []);
  return;
}

const permutedDomains = permuteDomain(domain) || [domain];
// sort permuted domains (length ascending)
const sortedPermutedDomains = permutedDomains.sort(
  (a, b) => a.length - b.length,
);
fork icon12
star icon15
watch icon2

+ 5 other calls in file

3
4
5
6
7
8
9
10
11
12
const tough = require('tough-cookie');

const Store = tough.Store;
const Cookie = tough.Cookie;
const permutePath = tough.permutePath;
const permuteDomain = tough.permuteDomain;

let redisClient = null;

class CookieStore extends Store {
fork icon0
star icon1
watch icon1

29
30
31
32
33
34
35
36
37
38
  return;
}

let cookies = [];
let store = this._readStore();
let domains = ToughCookie.permuteDomain(domain) || [domain];
for (let domain of domains) {
  if (!store[domain]) {
    continue;
  }
fork icon4
star icon7
watch icon2

+ 3 other calls in file