Skip to content

Commit

Permalink
fix(typescript): ref dom lib via triple-slash to fix some compile issues
Browse files Browse the repository at this point in the history
closes #126
  • Loading branch information
panva committed Dec 14, 2020
1 parent e4bf481 commit 175f273
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/runtime/node/fetch.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { get as http } from 'http'
import type { ClientRequest } from 'http'
import type { URL as URLtype } from 'url'
import { get as https, RequestOptions } from 'https'

import type { FetchFunction } from '../interfaces.d'
Expand All @@ -19,7 +20,7 @@ const fetch: FetchFunction = async (url: URL, timeout: number, options: Accepted
}
return new Promise((resolve, reject) => {
const { agent } = options
protocols[url.protocol](url, { agent, timeout }, async (response) => {
protocols[url.protocol](<URLtype>url, { agent, timeout }, async (response) => {
if (response.statusCode !== 200) {
reject(new JOSEError('Expected 200 OK from the JSON Web Key Set HTTP response'))
} else {
Expand Down
2 changes: 2 additions & 0 deletions src/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// <reference lib="dom"/>

/* eslint-disable @typescript-eslint/naming-convention */
import type { KeyObject } from 'crypto'

Expand Down
1 change: 1 addition & 0 deletions tsconfig/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"../src/util/random.ts"
],
"compilerOptions": {
"lib": ["ES6"],
"strict": true,
"forceConsistentCasingInFileNames": true,
"noUnusedLocals": true,
Expand Down

0 comments on commit 175f273

Please sign in to comment.