Skip to content

Commit

Permalink
chore: address new linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wjhsf committed Oct 1, 2024
1 parent 6dcaa5c commit 996bb03
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
8 changes: 4 additions & 4 deletions lib/__tests__/cookieJar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ describe('CookieJar', () => {
'http://other.example.com': ['other=qq; Path=/'],
'http://other.example.com/foo': ['other2=qq; Path=/foo'],
}
for await (const [url, cookies] of Object.entries(cookiesByUrl)) {
for await (const cookie of cookies) {
for (const [url, cookies] of Object.entries(cookiesByUrl)) {
for (const cookie of cookies) {
await cookieJar.setCookie(cookie, url)
}
}
Expand Down Expand Up @@ -995,8 +995,8 @@ describe('CookieJar', () => {
Cookie.parse('foo=bar; Domain=foo.com; Path=/'),
],
}
for await (const [path, cookies] of Object.entries(cookiesByDomain)) {
for await (const cookie of cookies) {
for (const [path, cookies] of Object.entries(cookiesByDomain)) {
for (const cookie of cookies) {
await cookieJar.setCookie(cookie as Cookie, path)
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/__tests__/jarSerialization.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ describe('cookieJar serialization', () => {
// getAllCookies to be exercised.
const paths = ['/', '/foo', '/foo/bar']
const domains = ['example.com', 'www.example.com', 'example.net']
for await (const path of paths) {
for await (const domain of domains) {
for (const path of paths) {
for (const domain of domains) {
const key = 'key'
const value = JSON.stringify({ path, domain })
const cookie = new Cookie({ expires, domain, path, key, value })
Expand Down
7 changes: 2 additions & 5 deletions lib/cookie/cookieJar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export class CookieJar {
let syncResult: T | undefined = undefined

try {
fn.call(this, (error: Error | null, result?: T | undefined) => {
fn.call(this, (error: Error | null, result?: T) => {
syncErr = error
syncResult = result
})
Expand Down Expand Up @@ -809,10 +809,7 @@ export class CookieJar {
* @param url - The domain to store the cookie with.
* @param options - Configuration settings to use when retrieving the cookies.
*/
getCookies(
url: string | URL,
options?: GetCookiesOptions | undefined,
): Promise<Cookie[]>
getCookies(url: string | URL, options?: GetCookiesOptions): Promise<Cookie[]>
/**
* @internal No doc because this is an overload that supports the implementation
*/
Expand Down

0 comments on commit 996bb03

Please sign in to comment.