File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 " es2015" ,
44 " stage-0" ,
55 " react"
6+ ],
7+ "plugins" : [
8+ " lodash"
69 ]
710}
Original file line number Diff line number Diff line change 1818 "devDependencies" : {
1919 "@case/eslint-config" : " ^0.1.4" ,
2020 "babel" : " ^6.0.15" ,
21+ "babel-cli" : " ^6.23.0" ,
2122 "babel-core" : " ^6.1.2" ,
2223 "babel-eslint" : " ^6.1.2" ,
2324 "babel-loader" : " ^6.0.1" ,
25+ "babel-plugin-lodash" : " ^3.2.11" ,
2426 "babel-preset-es2015" : " ^6.1.18" ,
2527 "babel-preset-react" : " ^6.1.18" ,
2628 "babel-preset-stage-0" : " ^6.1.18" ,
Original file line number Diff line number Diff line change 1- import map from 'lodash/map '
1+ import _ from 'lodash'
22
33const transforms = {
44 borderRadius : ( value ) => {
@@ -94,9 +94,9 @@ const transforms = {
9494
9595export const autoprefix = ( elements ) => {
9696 const prefixed = { }
97- map ( elements , ( styles , element ) => {
97+ _ . forOwn ( elements , ( styles , element ) => {
9898 let expanded = { }
99- map ( styles , ( value , key ) => {
99+ _ . forOwn ( styles , ( value , key ) => {
100100 const transform = transforms [ key ]
101101 if ( transform ) {
102102 expanded = { ...expanded , ...transform ( value ) }
Original file line number Diff line number Diff line change 1- import map from 'lodash/map'
2- import isPlainObject from 'lodash/isPlainObject'
3- import isString from 'lodash/isString'
1+ import _ from 'lodash'
42
53export const flattenNames = ( things ) => {
64 const names = [ ]
75
86 things . map ( ( thing ) => {
97 Array . isArray ( thing ) && flattenNames ( thing ) . map ( name => names . push ( name ) )
10- isPlainObject ( thing ) && map ( thing , ( value , key ) => {
8+ _ . isPlainObject ( thing ) && _ . forOwn ( thing , ( value , key ) => {
119 value === true && names . push ( key )
1210 names . push ( `${ key } -${ value } ` )
1311 } )
14- isString ( thing ) && names . push ( thing )
12+ _ . isString ( thing ) && names . push ( thing )
1513 return thing
1614 } )
1715
Original file line number Diff line number Diff line change 1- import map from 'lodash/map'
2- import cloneDeep from 'lodash/cloneDeep'
1+ import _ from 'lodash'
32
43export const mergeClasses = ( classes , activeNames = [ ] ) => {
5- const styles = ( classes . default && cloneDeep ( classes . default ) ) || { }
4+ const styles = ( classes . default && _ . cloneDeep ( classes . default ) ) || { }
65 activeNames . map ( ( name ) => {
76 const toMerge = classes [ name ]
87 if ( toMerge ) {
9- map ( toMerge , ( value , key ) => {
8+ _ . forOwn ( toMerge , ( value , key ) => {
109 if ( ! styles [ key ] ) {
1110 styles [ key ] = { }
1211 }
You can’t perform that action at this time.
0 commit comments