KyleRoss / node-lambda-log

Basic logging mechanism for Node.js Lambda Functions and other AWS services, which produces logs in JSON format for easier reading through Cloudwatch Logs.
https://lambdalog.dev
MIT License
193 stars 16 forks source link

log.options.meta is of type any - Unsafe member access .event on an any value. #28

Closed akleiber closed 4 years ago

akleiber commented 4 years ago

If using recommended rules the rule no-unsafe-member-access will disallow accessing log.options.meta because it is typed as any.

Would it be okay to type log.options.meta as Record<string, unknown> @KyleRoss ?

KyleRoss commented 4 years ago

@akleiber Yes, that should work. Is this due to the typings?

akleiber commented 4 years ago

Sorry for the delay :) Yes due to the typings - the types for lambda-log are managed via DefinitelyTyped right? So I guess I need to open a PR at https://github.com/DefinitelyTyped/DefinitelyTyped/pulls

KyleRoss commented 4 years ago

@akleiber That is correct, please feel free to open a PR there to get those fixed :) Let me know if you have any issues.