Skip to content

Use ES5 compatible camelcase library. #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"build:es": "cross-env BABEL_ENV=es babel src --out-dir es",
"build:commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir lib",
"build:umd": "cross-env NODE_ENV=development webpack",
"build:umd:min": "cross-env NODE_ENV=production webpack",
"build:umd:min": "cross-env NODE_ENV=production webpack && es-check es5 dist/redux-actions.min.js",
"build": "run-s clean && run-p build:**",
"clean": "rimraf coverage dist es lib",
"lint": "xo",
Expand Down Expand Up @@ -49,6 +49,7 @@
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"cross-env": "^2.0.0",
"es-check": "^2.0.4",
"eslint-config-jest-files": "^0.1.1",
"eslint-config-unicorn-camelcase": "^0.1.1",
"eslint-plugin-prettier": "^2.6.0",
Expand All @@ -64,11 +65,11 @@
"xo": "^0.20.3"
},
"dependencies": {
"camelcase": "^5.0.0",
"invariant": "^2.2.1",
"is-function": "^1.0.1",
"is-plain-object": "^2.0.4",
"is-symbol": "^1.0.1",
"lodash.camelcase": "^4.3.0",
"lodash.curry": "^4.1.1",
"reduce-reducers": "^0.1.0"
},
Expand Down
4 changes: 2 additions & 2 deletions src/utils/camelCase.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import camelCase from 'camelcase';
import camelCase from 'lodash.camelcase';

const namespacer = '/';

Expand All @@ -7,5 +7,5 @@ export default type =>
? camelCase(type)
: type
.split(namespacer)
.map(camelCase)
.map(part => camelCase(part))
Copy link
Contributor Author

@nowells nowells Jul 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

due to camelCase accepting multiple arguments, and map providing the index as a second argument, and entire array as 3rd.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure about this? We had it like this before as well with camelCase from lodash.

.join(namespacer);
Loading