File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ unsafeMkProps :: forall val. String -> val -> Props
1818unsafeUnfoldProps :: forall vals. String -> {  | vals } -> Props 
1919``` 
2020
21+ #### ` unsafePrefixProps `  
22+ 
23+ ```  purescript 
24+ unsafePrefixProps :: forall vals. String -> {  | vals } -> Props 
25+ ``` 
26+ 
2127#### ` unsafeFromPropsArray `  
2228
2329```  purescript 
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ function unsafeUnfoldProps(key) {
2222
2323    for  ( var  subprop  in  value )  { 
2424      if  ( value . hasOwnProperty ( subprop ) )  { 
25-            result [ subprop ]  =  value [ subprop ] ; 
25+         result [ subprop ]  =  value [ subprop ] ; 
2626      } 
2727    } 
2828
@@ -31,6 +31,21 @@ function unsafeUnfoldProps(key) {
3131} 
3232exports . unsafeUnfoldProps  =  unsafeUnfoldProps ; 
3333
34+ function  unsafePrefixProps ( prefix )  { 
35+   return  function ( value ) { 
36+     var  result  =  { } ; 
37+ 
38+     for  ( var  prop  in  value )  { 
39+       if  ( value . hasOwnProperty ( prop ) )  { 
40+         result [ prefix  +  prop ]  =  value [ prop ] ; 
41+       } 
42+     } 
43+ 
44+     return  result ; 
45+   } ; 
46+ } 
47+ exports . unsafePrefixProps  =  unsafePrefixProps ; 
48+ 
3449function  unsafeFromPropsArray ( props )  { 
3550  var  result  =  { } ; 
3651
Original file line number Diff line number Diff line change @@ -8,13 +8,15 @@ foreign import unsafeMkProps :: forall val. String -> val -> Props
88
99foreign  import  unsafeUnfoldProps  ::  forall  vals . String  ->  {  | vals  }  ->  Props 
1010
11+ foreign  import  unsafePrefixProps  ::  forall  vals . String  ->  {  | vals  }  ->  Props 
12+ 
1113foreign  import  unsafeFromPropsArray  ::  forall  props . Array  Props  ->  props 
1214
1315aria  ::  forall  ariaAttrs . {  | ariaAttrs  }  ->  Props 
14- aria = unsafeUnfoldProps  " aria" 
16+ aria = unsafePrefixProps  " aria- " 
1517
1618_data  ::  forall  dataAttrs . {  | dataAttrs  }  ->  Props 
17- _data = unsafeUnfoldProps  " data" 
19+ _data = unsafePrefixProps  " data- " 
1820
1921style  ::  forall  style . {  | style  }  ->  Props 
2022style = unsafeUnfoldProps " style" 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments