Merge pull request #5 from sliterok/patch-1
Moved definition of CookieJar.cookies because it caused TypeError on constructor
This commit is contained in:
		@@ -5,6 +5,8 @@ import {paramError, CookieParseError} from "./errors.mjs";
 | 
			
		||||
 | 
			
		||||
export default class CookieJar {
 | 
			
		||||
    constructor(file, flags = "rw", cookies, cookieIgnoreCallback) {
 | 
			
		||||
        this.cookies = new Map();
 | 
			
		||||
        
 | 
			
		||||
        if(file && typeof file !== "string")
 | 
			
		||||
            throw paramError("Second", "file", "new CookieJar()", "string");
 | 
			
		||||
        if(typeof flags !== "string")
 | 
			
		||||
@@ -22,7 +24,6 @@ export default class CookieJar {
 | 
			
		||||
            throw paramError("Fourth", "cookieIgnoreCallback", "new CookieJar()", "function");
 | 
			
		||||
        this.file = file;
 | 
			
		||||
        this.flags = flags;
 | 
			
		||||
        this.cookies = new Map();
 | 
			
		||||
        this.cookieIgnoreCallback = cookieIgnoreCallback;
 | 
			
		||||
    }
 | 
			
		||||
    addCookie(cookie, fromURL) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user