kbrabrand / camelize-ts

A typescript typed camelCase function that recursively camel cases a snake cased object structure
25 stars 6 forks source link

Use es2019 target for node 12-16 support? #8

Closed kbrabrand closed 2 years ago

kbrabrand commented 2 years ago

During CI on node 12 I got the following complaint:

There is a mismatch between your NodeJs version v12.22.9 and your TypeScript target es2020. This might lead to some unexpected errors when running tests with ts-jest. To fix this, you can check https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping

This PR adjusts the target from ES2020 👉 ES2019. I've tested it in a project and is seems to work fine, but since you were the one that proposed the changes for the move from cjs to esm, would you mind having a look, @jonkoops?

jonkoops commented 2 years ago

This is only the case for running the tests with TS Jest and does not affect the distributed package. Specifically if any syntax is used that might not be compatible with NodeJS 12. But since the tests are passing and the package itself does not contain any incompatible syntax this is not an issue.

I would just leave this as is, especially since NodeJS 12 will be end of life in April this year.

kbrabrand commented 2 years ago

Agree. The build artifact is identical though, so it wouldn't make a difference. But you have a point with node 12 end of life, so I won't bother.