Skip to content

Commit

Permalink
Update Dependencies (#127)
Browse files Browse the repository at this point in the history
* update dependencies

* Fix typescript version incompatibilites

Co-authored-by: DarcyRaynerDD <[email protected]>
Co-authored-by: DarcyRaynerDD <[email protected]>
Co-authored-by: Darcy Rayner <[email protected]>
  • Loading branch information
4 people authored Dec 4, 2020
1 parent ae65d9f commit e20aeed
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 100 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
"@types/jest": "^26.0.15",
"@types/mock-fs": "true4.13.0",
"@types/nock": "^11.1.0",
"@types/node": "^14.14.7",
"@types/node": "^14.14.10",
"@types/promise-retry": "^1.1.3",
"@types/shimmer": "^1.0.1",
"dd-trace": "0.28.1",
"dd-trace": "0.29.1",
"jest": "^26.6.3",
"mock-fs": "true4.13.0",
"nock": "13.0.5",
"prettier": "^2.1.2",
"prettier": "^2.2.1",
"ts-jest": "^26.4.4",
"tslint": "^6.1.3",
"typescript": "^4.0.5"
"typescript": "^4.1.2"
},
"dependencies": {
"aws-xray-sdk-core": "^3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/metrics/listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class MetricsListener {
logDebug(`Flushing statsD`);

// Make sure all stats are flushed to extension
await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
this.statsDClient?.close((error) => {
if (error !== undefined) {
reject(error);
Expand Down
8 changes: 4 additions & 4 deletions src/utils/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function wrap<TEvent, TResult>(
onStart: (event: TEvent, context: Context) => Promise<void>,
onComplete: (event: TEvent, context: Context, error?: Error) => Promise<void>,
onWrap?: OnWrapFunc,
): Handler<TEvent, TResult> {
): Handler<TEvent, TResult | undefined> {
const promHandler = promisifiedHandler(handler);

return async (event: TEvent, context: Context) => {
Expand All @@ -24,7 +24,7 @@ export function wrap<TEvent, TResult>(
const innerError = serializeError(error);
logError("Pre-lambda hook threw error", { innerError });
}
let result: TResult;
let result: TResult | undefined;

let handlerError: Error | undefined;
let wrappedHandler = promHandler;
Expand Down Expand Up @@ -71,7 +71,7 @@ export function promisifiedHandler<TEvent, TResult>(handler: Handler<TEvent, TRe
let modifiedLegacySucceedCallback: (res: any) => void = () => {};
let modifiedLegacyFailCallback: (err: any) => void = () => {};

const callbackProm = new Promise<TResult>((resolve, reject) => {
const callbackProm = new Promise<TResult | undefined>((resolve, reject) => {
modifiedCallback = (err, result) => {
if (err !== undefined && err !== null) {
reject(err);
Expand Down Expand Up @@ -103,7 +103,7 @@ export function promisifiedHandler<TEvent, TResult>(handler: Handler<TEvent, TRe
context.fail = modifiedLegacyFailCallback;

const asyncProm = handler(event, context, modifiedCallback) as Promise<TResult> | undefined;
let promise: Promise<TResult> = callbackProm;
let promise: Promise<TResult | undefined> = callbackProm;
if (asyncProm !== undefined && typeof asyncProm.then === "function") {
// Mimics behaviour of lambda runtime, the first method of returning a result always wins.
promise = Promise.race([callbackProm, asyncProm]);
Expand Down
Loading

0 comments on commit e20aeed

Please sign in to comment.