auth0 / node-jwks-rsa

A library to retrieve RSA public keys from a JWKS (JSON Web Key Set) endpoint.
MIT License
836 stars 236 forks source link

Fix issue with ES Express import #310

Closed adamjmcgrath closed 2 years ago

adamjmcgrath commented 2 years ago

Description

Use import = require() syntax to import a CommonJS style export = type from @types/express

References

fixes #309 https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/express/index.d.ts https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require

Testing

I'd like to remove the esModuleInterop flag from https://github.com/auth0/node-jwks-rsa/blob/master/tsconfig.json#L16 so our CI tests would verify this, but I can't because out express-jwt dependencies require this. So tested manually with basic TS config.

Checklist

rbutera commented 2 years ago

lets get this merged, latest release is breaking all of our nodejs auth0 apps