Skip to content

Commit

Permalink
upgrade typescript to 4x
Browse files Browse the repository at this point in the history
- fix a few types that it now cares about around promises
  • Loading branch information
Francis Gulotta committed Jan 15, 2021
1 parent f184ef4 commit ca095f7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/from-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface ReadableStreamish {
}

async function onceReadable(stream: ReadableStreamish) {
return new Promise(resolve => {
return new Promise<void>(resolve => {
stream.once('readable', () => {
resolve()
})
Expand Down
2 changes: 1 addition & 1 deletion lib/parallel-merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function* parallelMerge<I extends AnyIterable<any>[]>(
}
}

const waitForQueue = () =>
const waitForQueue = (): Promise<void> =>
new Promise((resolve, reject) => {
if (lastError) {
reject(lastError)
Expand Down
2 changes: 1 addition & 1 deletion lib/util-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export async function asyncStringArr(str) {
}

export function promiseImmediate<T>(data?: T) {
return new Promise(resolve => setImmediate(() => resolve(data))) as Promise<T>
return new Promise<undefined | T>(resolve => setImmediate(() => resolve(data))) as Promise<T>
}

export async function delayTicks<T>(count = 1, data?: T) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"tslint": "^6.1.2",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.3.0",
"typescript": "3.9.7"
"typescript": "4.1.3"
},
"engines": {
"node": ">=10"
Expand Down

0 comments on commit ca095f7

Please sign in to comment.