@@ -152,8 +152,7 @@ export function createAttributes(
152152 createEventHandler ( client , name , handler ) ,
153153 ) ,
154154 ) ,
155- // Convert snake_case to camelCase names
156- } ) . map ( normalizeAttribute ) ,
155+ } ) ,
157156 ) ;
158157}
159158
@@ -182,33 +181,3 @@ function createEventHandler(
182181 } ,
183182 ] ;
184183}
185-
186- function normalizeAttribute ( [ key , value ] : [ string , any ] ) : [ string , any ] {
187- let normKey = key ;
188- let normValue = value ;
189-
190- if ( key === "style" && typeof value === "object" ) {
191- normValue = Object . fromEntries (
192- Object . entries ( value ) . map ( ( [ k , v ] ) => [ snakeToCamel ( k ) , v ] ) ,
193- ) ;
194- } else if (
195- key . startsWith ( "data_" ) ||
196- key . startsWith ( "aria_" ) ||
197- DASHED_HTML_ATTRS . includes ( key )
198- ) {
199- normKey = key . split ( "_" ) . join ( "-" ) ;
200- } else {
201- normKey = snakeToCamel ( key ) ;
202- }
203- return [ normKey , normValue ] ;
204- }
205-
206- function snakeToCamel ( str : string ) : string {
207- return str . replace ( / ( [ _ ] [ a - z ] ) / g, ( group ) =>
208- group . toUpperCase ( ) . replace ( "_" , "" ) ,
209- ) ;
210- }
211-
212- // see list of HTML attributes with dashes in them:
213- // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes#attribute_list
214- const DASHED_HTML_ATTRS = [ "accept_charset" , "http_equiv" ] ;
0 commit comments