Skip to content

Commit b77c935

Browse files
committed
remove lodash dependencies
1 parent 48c1655 commit b77c935

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

Diff for: .babelrc

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"React": "react"
1212
}
1313
}],
14-
"lodash",
1514
"add-module-exports",
1615
"transform-remove-strict-mode"
1716
],

Diff for: package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"babel-loader": "^6.2.5",
3030
"babel-plugin-add-module-exports": "^0.2.1",
3131
"babel-plugin-import-rename": "^1.0.1",
32-
"babel-plugin-lodash": "^3.2.9",
3332
"babel-plugin-module-resolver": "^2.2.0",
3433
"babel-plugin-system-import-transformer": "^2.4.0",
3534
"babel-plugin-transform-remove-strict-mode": "^0.0.2",
@@ -58,6 +57,6 @@
5857
"dependencies": {
5958
"emit-lite": "^1.0.0",
6059
"fbjs": "^0.8.0",
61-
"lodash": "^4.0.0"
60+
"lodash.capitalize": "^4.2.1"
6261
}
6362
}

Diff for: src/injectable/applyAnimatedValues.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11

2-
import { isArray, capitalize, reduce } from 'lodash';
32
import invariant from 'fbjs/lib/invariant';
3+
import capitalize from 'lodash.capitalize';
44
import { findDOMNode } from 'react-dom';
55

66
import CSSPropertyOperations from 'react-dom/lib/CSSPropertyOperations';
77
// import CSSPropertyOperations from 'react/lib/CSSPropertyOperations';
88

9+
const reduce = (obj = {}, iterator, initialValue) => Object
10+
.keys(obj)
11+
.reduce(
12+
(returnValue, key) => iterator(returnValue, obj[key], key),
13+
initialValue,
14+
)
15+
;
16+
917
const prefix = (prop) => {
1018
if (typeof window === 'undefined') { return prop; }
1119

@@ -51,7 +59,7 @@ function mapTransform(transforms) {
5159

5260
function mapStyle(style) {
5361
return reduce(style, (finalStyle, value, prop) => {
54-
if (prop.indexOf('ransform') !== -1 && isArray(value)) {
62+
if (prop.indexOf('ransform') !== -1 && Array.isArray(value)) {
5563
value = value.map(mapTransform).join(' ');
5664
}
5765

Diff for: webpack.config.babel.js

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export default {
3131
'react',
3232
],
3333
plugins: [
34-
'lodash',
3534
'transform-remove-strict-mode',
3635
],
3736
cacheDirectory: true,

Diff for: yarn.lock

+5-8
Original file line numberDiff line numberDiff line change
@@ -381,13 +381,6 @@ babel-plugin-import-rename@^1.0.1:
381381
version "1.0.1"
382382
resolved "http://registry.npm.taobao.org/babel-plugin-import-rename/download/babel-plugin-import-rename-1.0.1.tgz#bd60618aa90a36dd944b186552da1dc389a449cf"
383383

384-
babel-plugin-lodash@^3.2.9:
385-
version "3.2.9"
386-
resolved "http://registry.npm.taobao.org/babel-plugin-lodash/download/babel-plugin-lodash-3.2.9.tgz#062f85aa7810fbb4374a1a7372ecc44b09168760"
387-
dependencies:
388-
glob "^7.0.6"
389-
lodash "^4.15.0"
390-
391384
babel-plugin-module-resolver:
392385
version "2.2.0"
393386
resolved "http://registry.npm.taobao.org/babel-plugin-module-resolver/download/babel-plugin-module-resolver-2.2.0.tgz#344d7bc06c7a530a3c9a15cb517cdb38e3bf152a"
@@ -2257,6 +2250,10 @@ lodash.assign@^4.0.3, lodash.assign@^4.0.6:
22572250
version "4.2.0"
22582251
resolved "http://registry.npm.taobao.org/lodash.assign/download/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7"
22592252

2253+
lodash.capitalize@^4.2.1:
2254+
version "4.2.1"
2255+
resolved "http://registry.npm.taobao.org/lodash.capitalize/download/lodash.capitalize-4.2.1.tgz#f826c9b4e2a8511d84e3aca29db05e1a4f3b72a9"
2256+
22602257
22612258
version "3.1.1"
22622259
resolved "http://registry.npm.taobao.org/lodash.create/download/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7"
@@ -2285,7 +2282,7 @@ lodash@^3.8.0:
22852282
version "3.10.1"
22862283
resolved "http://registry.npm.taobao.org/lodash/download/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
22872284

2288-
lodash@^4.0.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.5.0:
2285+
lodash@^4.2.0, lodash@^4.3.0, lodash@^4.5.0:
22892286
version "4.16.6"
22902287
resolved "http://registry.npm.taobao.org/lodash/download/lodash-4.16.6.tgz#d22c9ac660288f3843e16ba7d2b5d06cca27d777"
22912288

0 commit comments

Comments
 (0)