sindresorhus / camelcase-keys

Convert object keys to camel case
MIT License
691 stars 95 forks source link

Unexpected token '...'. Expected a property name on Safari 10 #45

Closed maafaishal-tkpd closed 5 years ago

maafaishal-tkpd commented 5 years ago
Screen Shot 2019-09-25 at 12 11 25

This is because Safari 10 is not supported object rest spread. This module should add @babel/plugin-transform-destructuring plugin to Webpack to handle this error.

sindresorhus commented 5 years ago

This module mainly targets Node.js, not the browser. It's up to you to transpile it with Babel if you want to use it in the browser. You can find a more detailed explanation here: https://github.com/sindresorhus/ama/issues/446

If you use Webpack, check out babel-engine-plugin, which transpiles only the dependencies that needs to be transpiled.

If you use Create React App, upgrade to Create React App v2. It supports automatic transpilation of dependencies, which will make this package just work.