Skip to content

Commit 1e76381

Browse files
authored
chore: update typescript to 4.4.4 (#359)
* chore: update typescript to 4.4.4 Signed-off-by: Grant Timmerman <[email protected]> * ci: fix lint issues Signed-off-by: Grant Timmerman <[email protected]>
1 parent a8e9c9a commit 1e76381

File tree

4 files changed

+14
-39
lines changed

4 files changed

+14
-39
lines changed

package-lock.json

Lines changed: 7 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@
5555
"power-assert": "1.6.1",
5656
"sinon": "^11.0.0",
5757
"supertest": "6.1.6",
58-
"typescript": "4.3.5"
58+
"typescript": "^4.4.4"
5959
}
6060
}

src/invoker.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ export function sendResponse(
8080
// CallFunction. The most sane resolution here is to succeed the function
8181
// (this was the customer's clear intent) but send a 204 (NO CONTENT) and
8282
// log an error message explaining why their content wasn't sent.
83-
console.error('Error serializing return value: ' + sendErr.toString());
83+
console.error(
84+
'Error serializing return value: ' + (sendErr as Error).toString()
85+
);
8486
res.sendStatus(204); // No Content
8587
}
8688
}

src/loader.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,10 @@ export async function getUserFunction(
155155

156156
return {userFunction: userFunction as HandlerFunction, signatureType};
157157
} catch (ex) {
158+
const err: Error = <Error>ex;
158159
let additionalHint: string;
159160
// TODO: this should be done based on ex.code rather than string matching.
160-
if (ex.stack && ex.stack.includes('Cannot find module')) {
161+
if (err.stack && err.stack.includes('Cannot find module')) {
161162
additionalHint =
162163
'Did you list all required modules in the package.json ' +
163164
'dependencies?\n';
@@ -166,7 +167,7 @@ export async function getUserFunction(
166167
}
167168
console.error(
168169
`Provided module can't be loaded.\n${additionalHint}` +
169-
`Detailed stack trace: ${ex.stack}`
170+
`Detailed stack trace: ${err.stack}`
170171
);
171172
return null;
172173
}

0 commit comments

Comments
 (0)