remove unnecessary re-initialization of CookieJar.cookies
This commit is contained in:
parent
946c711e90
commit
e5bf5729d1
|
@ -13,8 +13,6 @@ export default class CookieJar {
|
||||||
throw new TypeError("Second parameter is not a string!");
|
throw new TypeError("Second parameter is not a string!");
|
||||||
if(this.file && fs.existsSync(this.file))
|
if(this.file && fs.existsSync(this.file))
|
||||||
this.addFromFile(this.file);
|
this.addFromFile(this.file);
|
||||||
else
|
|
||||||
this.cookies = new Map();
|
|
||||||
if(Array.isArray(cookies)) {
|
if(Array.isArray(cookies)) {
|
||||||
if(!cookies.every(c => c instanceof Cookie))
|
if(!cookies.every(c => c instanceof Cookie))
|
||||||
throw new TypeError("Third parameter is not an array of cookies!");
|
throw new TypeError("Third parameter is not an array of cookies!");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user