Is there a way to make babel transform Object.hasOwn?

Viewed 16
1 Answers

You can transform any code into another code using babel, that is exactly the role of babel transformations. Seems that there is one plugin available (disclaimer: I've never used it) but you can how the function would look like after the babel transformation, or you could also write your own babel-plugin for it.

You could also ship a polyfill together with your library, or require it as a dependency of your library.

Related