Fix support for CJS and add support for Mongoose 8 (and MongoDB 7) #456
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #453 and #454. I've tested it with CommonJS and ESM. Build, Test, Lint etc. are working fine too.
Notable changes
Regarding #453:
express-restify-mongoose
8 broke support for CJS, meaning it could only be used withimport
(ESM) and not withrequire
(CJS) anymore)serialize-error
to^8.1.0
anddot-prop
to^6.0.0
in order to add support for CJS again.eslint-plugin-mocha
to10.3.0
because with10.4.0
the minimum node version was increased to18
."type": "module"
from thepackage.json
(necessary to support CJS)9.0.0
Regarding #454:
.findOneAndRemove()
and.remove()
...delete body.errors.customer.message;
in order keep support for older Mongoose versions, which in my opinion doesn't have a negative impact.