Skip to content

Commit

Permalink
Merge pull request #307 from snyk/fix/typescript-promise-issues
Browse files Browse the repository at this point in the history
Fix/typescript promise issues
  • Loading branch information
agatakrajewska authored Nov 20, 2020
2 parents a4b61d4 + 249936b commit a974797
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class Docker {

const modem = new Modem();

return new Promise((resolve, reject) => {
return new Promise<void>((resolve, reject) => {
modem.dial(request, (err, stream: Stream) => {
if (err) {
return reject(err);
Expand Down
4 changes: 2 additions & 2 deletions lib/stream-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ async function streamToHash(
stream: Readable,
hashAlgorithm: string,
): Promise<string> {
return new Promise((resolve, reject) => {
return new Promise<string>((resolve, reject) => {
const hash = crypto.createHash(hashAlgorithm);
hash.setEncoding(HASH_ENCODING);

stream.on("end", () => {
hash.end();
resolve(hash.read());
resolve(hash.read().toString(HASH_ENCODING));
});

stream.on("error", (error) => reject(error));
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"uuid": "^8.2.0"
},
"devDependencies": {
"@types/node": "^8.10.48",
"@types/node": "8.10.48",
"@types/sinon": "5.0.5",
"@types/tar-stream": "^1.6.1",
"@types/tmp": "^0.2.0",
Expand All @@ -57,7 +57,7 @@
"tsc-watch": "^4.2.8",
"tslint": "^5.16.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "^4.0.3",
"typescript": "4.0.3",
"jest": "^26.4.2",
"ts-jest": "^26.4.0"
}
Expand Down

0 comments on commit a974797

Please sign in to comment.