Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eventNormalizer doesn't export a function under CommonJS #1052

Closed
kitsunde opened this issue May 15, 2023 · 2 comments
Closed

eventNormalizer doesn't export a function under CommonJS #1052

kitsunde opened this issue May 15, 2023 · 2 comments
Labels

Comments

@kitsunde
Copy link

For whatever reason in 4.4.1 the @middy/event-normalizer export doesn't export a middleware, instead it's under default. Meanwhile input-putput-logger does, which is confusing.

const { default: eventNormalizer } = require('@middy/event-normalizer');
const inputOutputLogger = require('@middy/input-output-logger');

console.log(eventNormalizer, inputOutputLogger)

Produces:

[Function: eventNormalizerMiddleware] [Function: inputOutputLoggerMiddleware]

It would be nice if the exports under CJS could be made consistent.

@kitsunde kitsunde added the bug label May 15, 2023
@willfarrell
Copy link
Member

I see the issue. They both are setup the same way, except eventNormalizerMiddleware has an additional export for a helper function. Releasing what I think should fix it now. Re-open if it needs more attention

@kitsunde
Copy link
Author

I can confirm it's working, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants