Skip to content

Commit 48ef968

Browse files
fix: Specify promise type to match resolve() call
There has been typescript changes, where the value is required in the resolve callback for a new Promise. When resolve is called without arguments, we need to specify type void on the new Promise. More information: microsoft/TypeScript#39817
1 parent 9600019 commit 48ef968

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/docker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class Docker {
9090

9191
const modem = new Modem();
9292

93-
return new Promise((resolve, reject) => {
93+
return new Promise<void>((resolve, reject) => {
9494
modem.dial(request, (err, stream: Stream) => {
9595
if (err) {
9696
return reject(err);

lib/stream-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ async function streamToHash(
4242
stream: Readable,
4343
hashAlgorithm: string,
4444
): Promise<string> {
45-
return new Promise((resolve, reject) => {
45+
return new Promise<string>((resolve, reject) => {
4646
const hash = crypto.createHash(hashAlgorithm);
4747
hash.setEncoding(HASH_ENCODING);
4848

4949
stream.on("end", () => {
5050
hash.end();
51-
resolve(hash.read());
51+
resolve(hash.read().toString());
5252
});
5353

5454
stream.on("error", (error) => reject(error));

0 commit comments

Comments
 (0)