Skip to content

Commit dd50a6f

Browse files
committed
fix: correctly check for lambda environment
1 parent 6d7c926 commit dd50a6f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export type PinoLambdaLogger = Logger & {
8484
* that provides convinience methods for use with AWS Lambda
8585
*/
8686
export default (extendedPinoOptions?: ExtendedPinoOptions): PinoLambdaLogger => {
87-
if (!isLamdbaExecution) {
87+
if (!isLamdbaExecution()) {
8888
return (pino(extendedPinoOptions) as unknown) as PinoLambdaLogger;
8989
}
9090

src/tests/index.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import tap from 'tap';
22
import sinon from 'sinon';
33
import pino, { PinoLambdaLogger, ExtendedPinoOptions } from '../index';
44

5+
process.env.AWS_EXECUTION_ENV = 'AWS_Lambda_nodejs14';
56
sinon.useFakeTimers(Date.UTC(2016, 11, 1, 6, 0, 0, 0));
67

78
tap.test('should log a simple info message', (t) => {

0 commit comments

Comments
 (0)