Skip to content

Commit

Permalink
perf(optional): use strict equal instead of typeof
Browse files Browse the repository at this point in the history
  • Loading branch information
H4ad committed Jun 7, 2023
1 parent 3d65895 commit 1fba12c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/adapters/aws/api-gateway-v2.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
getDefaultIfUndefined,
getEventBodyAsBuffer,
getFlattenedHeadersMap,
getPathWithQueryStringParams,
getFlattenedHeadersMapAndCookies,
getPathWithQueryStringParams,
} from '../../core';

//#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/core/optional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function getDefaultIfUndefined<T>(
value: T | undefined,
defaultValue: T,
): T {
if (typeof value === 'undefined') return defaultValue;
if (value === undefined) return defaultValue;

return value;
}

0 comments on commit 1fba12c

Please sign in to comment.