@@ -36,16 +36,16 @@ export function createCustomEvent (name, args) {
3636const  isBoolean  =  val  =>  / f u n c t i o n   B o o l e a n / . test ( String ( val ) ) 
3737const  isNumber  =  val  =>  / f u n c t i o n   N u m b e r / . test ( String ( val ) ) 
3838
39- export  function  convertAttributeValue  ( value ,  name ,  options )  { 
40-  if  ( isBoolean ( options . type ) )  { 
39+ export  function  convertAttributeValue  ( value ,  name ,  {  type  }   =   { } )  { 
40+  if  ( isBoolean ( type ) )  { 
4141 if  ( value  ===  'true'  ||  value  ===  'false' )  { 
4242 return  value  ===  'true' 
4343 } 
4444 if  ( value  ===  ''  ||  value  ===  name )  { 
4545 return  true 
4646 } 
4747 return  value  !=  null 
48-  }  else  if  ( isNumber ( options . type ) )  { 
48+  }  else  if  ( isNumber ( type ) )  { 
4949 const  parsed  =  parseFloat ( value ,  10 ) 
5050 return  isNaN ( parsed )  ? value  : parsed 
5151 }  else  { 
@@ -55,7 +55,7 @@ export function convertAttributeValue (value, name, options) {
5555
5656export  function  toVNodes  ( h ,  children )  { 
5757 const  res  =  [ ] 
58-  for  ( let  i  =  0 ;   i   <  children . length ;  i ++ )  { 
58+  for  ( let  i  =  0 ,   l   =  children . length ;   i   <   l ;  i ++ )  { 
5959 res . push ( toVNode ( h ,  children [ i ] ) ) 
6060 } 
6161 return  res 
@@ -83,7 +83,7 @@ function toVNode (h, node) {
8383
8484function  getAttributes  ( node )  { 
8585 const  res  =  { } 
86-  for  ( let  i  =  0 ;   i   <  node . attributes . length ;  i ++ )  { 
86+  for  ( let  i  =  0 ,   l   =  node . attributes . length ;   i   <   l ;  i ++ )  { 
8787 const  attr  =  node . attributes [ i ] 
8888 res [ attr . nodeName ]  =  attr . nodeValue 
8989 } 
0 commit comments