@@ -39,16 +39,16 @@ function createCustomEvent (name, args) {
3939const  isBoolean  =  val  =>  / f u n c t i o n   B o o l e a n / . test ( String ( val ) ) ; 
4040const  isNumber  =  val  =>  / f u n c t i o n   N u m b e r / . test ( String ( val ) ) ; 
4141
42- function  convertAttributeValue  ( value ,  name ,  options )  { 
43-  if  ( isBoolean ( options . type ) )  { 
42+ function  convertAttributeValue  ( value ,  name ,  {  type  }   =   { } )  { 
43+  if  ( isBoolean ( type ) )  { 
4444 if  ( value  ===  'true'  ||  value  ===  'false' )  { 
4545 return  value  ===  'true' 
4646 } 
4747 if  ( value  ===  ''  ||  value  ===  name )  { 
4848 return  true 
4949 } 
5050 return  value  !=  null 
51-  }  else  if  ( isNumber ( options . type ) )  { 
51+  }  else  if  ( isNumber ( type ) )  { 
5252 const  parsed  =  parseFloat ( value ,  10 ) ; 
5353 return  isNaN ( parsed )  ? value  : parsed 
5454 }  else  { 
@@ -58,7 +58,7 @@ function convertAttributeValue (value, name, options) {
5858
5959function  toVNodes  ( h ,  children )  { 
6060 const  res  =  [ ] ; 
61-  for  ( let  i  =  0 ;   i   <  children . length ;  i ++ )  { 
61+  for  ( let  i  =  0 ,   l   =  children . length ;   i   <   l ;  i ++ )  { 
6262 res . push ( toVNode ( h ,  children [ i ] ) ) ; 
6363 } 
6464 return  res 
@@ -86,7 +86,7 @@ function toVNode (h, node) {
8686
8787function  getAttributes  ( node )  { 
8888 const  res  =  { } ; 
89-  for  ( let  i  =  0 ;   i   <  node . attributes . length ;  i ++ )  { 
89+  for  ( let  i  =  0 ,   l   =  node . attributes . length ;   i   <   l ;  i ++ )  { 
9090 const  attr  =  node . attributes [ i ] ; 
9191 res [ attr . nodeName ]  =  attr . nodeValue ; 
9292 } 
0 commit comments