File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,16 @@ import _ from 'lodash';
22
33const styleNameIndex = { } ;
44
5- export default ( styleNamePropertyValue : string , allowMultiple : boolean ) : Array < string > => {
5+ export default ( styleNamePropertyValue : ( string | array ) , allowMultiple : boolean ) : Array < string > => {
66 let styleNames ;
7+ let isArray = Array . isArray ( styleNamePropertyValue )
78
8- if ( styleNameIndex [ styleNamePropertyValue ] ) {
9+ if ( ! isArray && styleNameIndex [ styleNamePropertyValue ] ) {
910 styleNames = styleNameIndex [ styleNamePropertyValue ] ;
1011 } else {
11- styleNames = _ . trim ( styleNamePropertyValue ) . split ( ' ' ) ;
12+ styleNames = isArray
13+ ? styleNamePropertyValue . filter ( styleNameItem => typeof styleNameItem === 'string' )
14+ : _ . trim ( styleNamePropertyValue ) . split ( ' ' ) ;
1215 styleNames = _ . filter ( styleNames ) ;
1316
1417 styleNameIndex [ styleNamePropertyValue ] = styleNames ;
You can’t perform that action at this time.
0 commit comments