Skip to content

Commit

Permalink
Replace Nullable<T> with more precise T | undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
wjhsf committed Mar 15, 2024
1 parent 4ba4af0 commit 8a83cf8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/cookie/cookieJar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ export class CookieJar {
}
}

const withCookie: Callback<Nullable<Cookie>> = function withCookie(
const withCookie: Callback<Cookie | undefined> = function withCookie(
err,
oldCookie,
): void {
Expand Down
2 changes: 1 addition & 1 deletion lib/memstore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class MemoryCookieStore extends Store {
domain: Nullable<string>,
path: Nullable<string>,
key: Nullable<string>,
): Promise<Nullable<Cookie>>
): Promise<Cookie | undefined>
override findCookie(
domain: Nullable<string>,
path: Nullable<string>,
Expand Down
6 changes: 3 additions & 3 deletions lib/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ export class Store {
domain: Nullable<string>,
path: Nullable<string>,
key: Nullable<string>,
): Promise<Nullable<Cookie>>
): Promise<Cookie | undefined>
findCookie(
domain: Nullable<string>,
path: Nullable<string>,
key: Nullable<string>,
callback: Callback<Nullable<Cookie>>,
callback: Callback<Cookie | undefined>,
): void
findCookie(
_domain: Nullable<string>,
_path: Nullable<string>,
_key: Nullable<string>,
_callback?: Callback<Nullable<Cookie>>,
_callback?: Callback<Cookie | undefined>,
): unknown {
throw new Error('findCookie is not implemented')
}
Expand Down

0 comments on commit 8a83cf8

Please sign in to comment.