Skip to content

Commit

Permalink
fix(typescript): work around potentially missing global URL from DOM lib
Browse files Browse the repository at this point in the history
This is a workaround for DefinitelyTyped/DefinitelyTyped#34960

closes #295
  • Loading branch information
panva committed Oct 21, 2021
1 parent 87cff3d commit 7ed731c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/jwks/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function isJWKLike(key: unknown) {
}

class RemoteJWKSet {
private _url: URL
private _url: globalThis.URL

private _timeoutDuration: number

Expand All @@ -83,7 +83,7 @@ class RemoteJWKSet {

private _options: Pick<RemoteJWKSetOptions, 'agent'>

constructor(url: URL, options?: RemoteJWKSetOptions) {
constructor(url: unknown, options?: RemoteJWKSetOptions) {
if (!(url instanceof URL)) {
throw new TypeError('url must be an instance of URL')
}
Expand Down Expand Up @@ -212,6 +212,10 @@ class RemoteJWKSet {
}
}

interface URL {
href: string
}

/**
* Returns a function that resolves to a key object downloaded from a
* remote endpoint returning a JSON Web Key Set, that is, for example,
Expand Down

0 comments on commit 7ed731c

Please sign in to comment.