Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
var tough = require('tough-cookie');
var Store = tough.Store;
var permuteDomain = tough.permuteDomain;
var permutePath = tough.permutePath;
var util = require('util');
var fs = require('fs');
function FileCookieStore(filePath) {
Store.call(this);
this.idx = {}; // idx is memory cache
this.filePath = filePath;
var self = this;
loadFromFile(this.filePath, function(dataJson) {
if (dataJson)
self.idx = dataJson;
})
}
var _ = require('lodash'),
util = require('util'),
Store = require('tough-cookie').Store,
Cookie = require('tough-cookie').Cookie,
EXECUTION_EVENT_BASE = 'execution.cookies.',
EVENT_STORE_ACTION = 'store',
STORE_METHODS = [
'findCookie', 'findCookies', 'putCookie', 'updateCookie',
'removeCookie', 'removeCookies', 'removeAllCookies', 'getAllCookies'
],
FUNCTION = 'function',
arrayProtoSlice = Array.prototype.slice,
PostmanCookieStore;
PostmanCookieStore = function PostmanCookieStore (id, emitter, timers) {
Store.call(this);
const tough = require('tough-cookie'),
Store = tough.Store,
permuteDomain = tough.permuteDomain,
permutePath = tough.permutePath,
fs = require('fs'),
helpers = require('./helpers'),
path = require('path');
class CookieFilestore extends Store {
constructor() {
super();
this.synchronous = true;
this.filePath = path.join(process.env.HOME, '.raiden', 'cookies.json');