Use ES6 `Class` syntax with `extends` instead of [`utils.inherits`](https://nodejs.org/docs/latest-v14.x/api/util.html#util_util_inherits_constructor_superconstructor) https://github.com/node-oauth/node-oauth2-server/blob/485147fb156310527456e06da41780b188cf2ca1/lib/grant-types/authorization-code-grant-type.js#L47 https://github.com/node-oauth/node-oauth2-server/blob/485147fb156310527456e06da41780b188cf2ca1/lib/grant-types/client-credentials-grant-type.js#L40 https://github.com/node-oauth/node-oauth2-server/blob/485147fb156310527456e06da41780b188cf2ca1/lib/grant-types/password-grant-type.js#L42 https://github.com/node-oauth/node-oauth2-server/blob/485147fb156310527456e06da41780b188cf2ca1/lib/grant-types/refresh-token-grant-type.js#L47 This also occurs in all the errors at `lib/errors`
Activity
dannyreg commentedon Nov 15, 2021
Wouldn't this require to change these functions to be
class AuthorizationCodeGrantType extends AbstractGrantType?jwerre commentedon Nov 15, 2021
Yes.
Uzlopak commentedon Nov 15, 2021
Try out https://lebab.unibtc.me/editor
jankapunkt commentedon Nov 16, 2021
Since #58 is merged I could start working on this on a new branch
dsschiramm commentedon Dec 18, 2021
I'll start with this issue ok?
Seems like a good start for me (first time in a project doing something in an opensource project)
dsschiramm commentedon Dec 18, 2021
Should I change the way the import is written as well?
Example:
const AbstractGrantType = require('./abstract-grant-type');To
import AbstractGrantType from './abstract-grant-type';Or should I leave this change for another issue/pull request?
Uzlopak commentedon Dec 18, 2021
Dont change, as it would just open the whole can of worms of esModule imports potentially breaking while running on node because of some reasons.
refactor: Remove util.inherits node-oauth#70
refactor: Remove util.inherits node-oauth#70
refactor: Remove util.inherits node-oauth#70
refactor(deps): remove util.inherits #70