fix TypeError when passing a CookieJar without the "r" flag to fetch
bump patch version to 1.3.5
This commit is contained in:
parent
f18fc55999
commit
ba2f52ae08
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "node-fetch-cookies",
|
||||
"version": "1.3.4",
|
||||
"version": "1.3.5",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "node-fetch-cookies",
|
||||
"version": "1.3.4",
|
||||
"version": "1.3.5",
|
||||
"description": "node-fetch wrapper that adds support for cookie-jars",
|
||||
"main": "src/index.mjs",
|
||||
"engines": {
|
||||
|
|
|
@ -19,8 +19,9 @@ async function fetch(cookieJars, url, options) {
|
|||
if(cookieJars) {
|
||||
if(Array.isArray(cookieJars) && cookieJars.every(c => c instanceof CookieJar))
|
||||
addValidFromJars(cookieJars.filter(jar => jar.flags.includes("r")));
|
||||
else if(cookieJars instanceof CookieJar && cookieJars.flags.includes("r"))
|
||||
addValidFromJars([cookieJars]);
|
||||
else if(cookieJars instanceof CookieJar)
|
||||
if(cookieJars.flags.includes("r"))
|
||||
addValidFromJars([cookieJars]);
|
||||
else
|
||||
throw paramError("First", "cookieJars", "fetch", ["CookieJar", "[CookieJar]"]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user