http-cookie-agent
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -51,3 +51,3 @@ "use strict"; | ||
if (cookie === undefined) { | ||
if (cookie == null) { | ||
continue; | ||
@@ -71,3 +71,3 @@ } | ||
if (req._header === null) { | ||
if (req._header == null) { | ||
req.setHeader('Cookie', cookieHeader); | ||
@@ -91,3 +91,3 @@ return; | ||
if (firstChunk === undefined) { | ||
if (firstChunk == null) { | ||
return; | ||
@@ -120,3 +120,3 @@ } | ||
if (cookies !== undefined) { | ||
if (cookies != null) { | ||
for (const cookie of cookies) { | ||
@@ -123,0 +123,0 @@ await this.jar.setCookie(cookie, requestUrl, { |
@@ -26,5 +26,5 @@ "use strict"; | ||
function createCookieClient(BaseAgentClass) { | ||
function createCookieClient(BaseClientClass) { | ||
// @ts-expect-error ... | ||
class CookieClient extends BaseAgentClass { | ||
class CookieClient extends BaseClientClass { | ||
constructor(url, { | ||
@@ -31,0 +31,0 @@ cookies: cookieOpts, |
{ | ||
"name": "http-cookie-agent", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Allows cookies with every Node.js HTTP clients.", | ||
@@ -71,3 +71,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@3846masa/configs": "github:3846masa/configs", | ||
"@3846masa/configs": "github:3846masa/configs#a45bbd3e20a59f0c83aef18648144d8f04884f9b", | ||
"@babel/cli": "^7.17.10", | ||
@@ -92,3 +92,2 @@ "@babel/core": "7.17.10", | ||
"deasync": "0.1.26", | ||
"eslint-import-resolver-typescript": "2.7.1", | ||
"got": "12.0.4", | ||
@@ -95,0 +94,0 @@ "http-proxy": "1.18.1", |
@@ -0,4 +1,5 @@ | ||
import type { CookieJar } from 'tough-cookie'; | ||
import type { Agent, Client } from 'undici'; | ||
interface CookieOptions { | ||
export interface CookieOptions { | ||
async_UNSTABLE?: true; | ||
@@ -8,3 +9,3 @@ jar: CookieJar; | ||
namespace CookieAgent { | ||
export namespace CookieAgent { | ||
export interface Options extends Agent.Options { | ||
@@ -15,7 +16,7 @@ cookies?: CookieOptions | undefined; | ||
class CookieAgent extends Agent { | ||
constructor(options: CookieAgent.Options = {}); | ||
export class CookieAgent extends Agent { | ||
constructor(options?: CookieAgent.Options); | ||
} | ||
namespace CookieClient { | ||
export namespace CookieClient { | ||
export interface Options extends Client.Options { | ||
@@ -26,10 +27,8 @@ cookies?: CookieOptions | undefined; | ||
class CookieClient extends Client { | ||
export class CookieClient extends Client { | ||
constructor(url: string | URL, options?: CookieClient.Options); | ||
} | ||
function createCookieClient<BaseClient extends Client = Client, BaseClientOptions = unknown>( | ||
BaseClient: new (origin: URL, options: BaseClientOptions) => BaseClient, | ||
): new (origin: URL, options: BaseClientOptions & { cookies?: CookieOptions | undefined }) => CookieAgent<BaseAgent>; | ||
export { CookieAgent, CookieClient, createCookieClient }; | ||
export function createCookieClient<BaseClient extends Client = Client, BaseClientOptions = unknown>( | ||
BaseClientClass: new (origin: string | URL, options: BaseClientOptions) => BaseClient, | ||
): new (origin: string | URL, options?: BaseClientOptions & { cookies?: CookieOptions | undefined }) => BaseClient; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
31085
36
0