Skip to content

Commit 9cad95b

Browse files
committed
Using babel-plugin-lodash.
1 parent c4bd4c1 commit 9cad95b

File tree

7 files changed

+18
-23
lines changed

7 files changed

+18
-23
lines changed

.babelrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"stage": 0
2+
"stage": 0,
3+
"plugins": [
4+
"lodash"
5+
]
36
}

dist/linkClass.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
'use strict';
22

3+
var _lodashLangIsArray2 = require('lodash/lang/isArray');
4+
5+
var _lodashLangIsArray3 = _interopRequireDefault(_lodashLangIsArray2);
6+
37
Object.defineProperty(exports, '__esModule', {
48
value: true
59
});
610

7-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
8-
911
var _react = require('react');
1012

1113
var _react2 = _interopRequireDefault(_react);
@@ -14,9 +16,7 @@ var _makeConfiguration = require('./makeConfiguration');
1416

1517
var _makeConfiguration2 = _interopRequireDefault(_makeConfiguration);
1618

17-
var _utils = require('./utils');
18-
19-
var _utils2 = _interopRequireDefault(_utils);
19+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
2020

2121
var linkClass = undefined;
2222

@@ -76,7 +76,7 @@ linkClass = function (element, styles, userConfiguration) {
7676

7777
if (_react2['default'].isValidElement(element.props.children)) {
7878
newChildren = linkClass(_react2['default'].Children.only(element.props.children), styles, configuration);
79-
} else if (_utils2['default'].isArray(element.props.children)) {
79+
} else if ((0, _lodashLangIsArray3['default'])(element.props.children)) {
8080
newChildren = _react2['default'].Children.map(element.props.children, function (node) {
8181
if (_react2['default'].isValidElement(node)) {
8282
return linkClass(node, styles, configuration);

dist/makeConfiguration.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
'use strict';
22

3+
var _lodashCollectionForEach2 = require('lodash/collection/forEach');
4+
5+
var _lodashCollectionForEach3 = _interopRequireDefault(_lodashCollectionForEach2);
6+
37
Object.defineProperty(exports, '__esModule', {
48
value: true
59
});
610

711
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
812

9-
var _utils = require('./utils');
10-
11-
var _utils2 = _interopRequireDefault(_utils);
12-
1313
/**
1414
* @typedef CSSModules~Options
1515
* @see {@link https://github.com/gajus/react-css-modules#options}
@@ -32,7 +32,7 @@ exports['default'] = function () {
3232
errorWhenNotFound: true
3333
};
3434

35-
_utils2['default'].forEach(userConfiguration, function (value, name) {
35+
(0, _lodashCollectionForEach3['default'])(userConfiguration, function (value, name) {
3636
if (typeof configuration[name] === 'undefined') {
3737
throw new Error('Unknown configuration property "' + name + '".');
3838
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"babel": "^5.8.23",
2727
"babel-eslint": "^4.1.2",
2828
"babel-istanbul": "^0.3.20",
29+
"babel-plugin-lodash": "^0.2.0",
2930
"chai": "^3.2.0",
3031
"coveralls": "^2.11.4",
3132
"eslint": "^1.4.3",

src/linkClass.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import makeConfiguration from './makeConfiguration';
3-
import _ from './utils';
3+
import _ from 'lodash';
44

55
let linkClass;
66

src/makeConfiguration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import _ from './utils';
1+
import _ from 'lodash';
22

33
/**
44
* @typedef CSSModules~Options

src/utils.js

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

0 commit comments

Comments
 (0)