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",
|
"name": "node-fetch-cookies",
|
||||||
"version": "1.3.4",
|
"version": "1.3.5",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "node-fetch-cookies",
|
"name": "node-fetch-cookies",
|
||||||
"version": "1.3.4",
|
"version": "1.3.5",
|
||||||
"description": "node-fetch wrapper that adds support for cookie-jars",
|
"description": "node-fetch wrapper that adds support for cookie-jars",
|
||||||
"main": "src/index.mjs",
|
"main": "src/index.mjs",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
|
@ -19,7 +19,8 @@ async function fetch(cookieJars, url, options) {
|
||||||
if(cookieJars) {
|
if(cookieJars) {
|
||||||
if(Array.isArray(cookieJars) && cookieJars.every(c => c instanceof CookieJar))
|
if(Array.isArray(cookieJars) && cookieJars.every(c => c instanceof CookieJar))
|
||||||
addValidFromJars(cookieJars.filter(jar => jar.flags.includes("r")));
|
addValidFromJars(cookieJars.filter(jar => jar.flags.includes("r")));
|
||||||
else if(cookieJars instanceof CookieJar && cookieJars.flags.includes("r"))
|
else if(cookieJars instanceof CookieJar)
|
||||||
|
if(cookieJars.flags.includes("r"))
|
||||||
addValidFromJars([cookieJars]);
|
addValidFromJars([cookieJars]);
|
||||||
else
|
else
|
||||||
throw paramError("First", "cookieJars", "fetch", ["CookieJar", "[CookieJar]"]);
|
throw paramError("First", "cookieJars", "fetch", ["CookieJar", "[CookieJar]"]);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user