Skip to content

Commit c4ef6f9

Browse files
committed
Outsource isPlainObject() to Lodash
1 parent 1cba5a4 commit c4ef6f9

File tree

5 files changed

+10
-47
lines changed

5 files changed

+10
-47
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"dependencies": {
7171
"hoist-non-react-statics": "^1.0.3",
7272
"invariant": "^2.0.0",
73+
"lodash": "^4.1.0",
7374
"loose-envify": "^1.1.0"
7475
},
7576
"peerDependencies": {

src/components/connect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const { Component, createElement } = require('react')
22
const storeShape = require('../utils/storeShape')
33
const shallowEqual = require('../utils/shallowEqual')
4-
const isPlainObject = require('../utils/isPlainObject')
54
const wrapActionCreators = require('../utils/wrapActionCreators')
5+
const isPlainObject = require('lodash/isPlainObject')
66
const hoistStatics = require('hoist-non-react-statics')
77
const invariant = require('invariant')
88

src/utils/isPlainObject.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

test/utils/isPlainObject.spec.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

webpack.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ var config = {
3232
libraryTarget: 'umd'
3333
},
3434
plugins: [
35+
{
36+
apply: function apply(compiler) {
37+
compiler.parser.plugin('expression global', function expressionGlobalPlugin() {
38+
this.state.module.addVariable('global', "(function() { return this; }()) || Function('return this')()")
39+
return false
40+
})
41+
}
42+
},
3543
new webpack.optimize.OccurenceOrderPlugin(),
3644
new webpack.DefinePlugin({
3745
'process.env.NODE_ENV': JSON.stringify(env)

0 commit comments

Comments
 (0)