@@ -19,17 +19,17 @@ const normalizedCache = new WeakMap()
1919// Pre-computes hash to avoid repeated calculations
2020function fastHashEndpoints ( endpoints ) {
2121 if ( ! Array . isArray ( endpoints ) || endpoints . length === 0 ) return ''
22-
22+
2323 let hash = endpoints . length . toString ( )
2424 const first = endpoints [ 0 ]
2525 const last = endpoints [ endpoints . length - 1 ]
26-
26+
2727 // Hash first endpoint
2828 hash += '|' + ( typeof first === 'string' ? first : ( first . url || '' ) + ( first . methods ? first . methods . join ( ',' ) : '' ) )
29-
29+
3030 // Hash last endpoint (catches most variations)
3131 hash += '|' + ( typeof last === 'string' ? last : ( last . url || '' ) + ( last . methods ? last . methods . join ( ',' ) : '' ) )
32-
32+
3333 return hash
3434}
3535
@@ -39,24 +39,24 @@ function normalizeEndpoint (endpoint) {
3939 if ( typeof endpoint === 'string' ) {
4040 return { url : endpoint , methods : [ 'GET' ] , updateParams : false }
4141 }
42-
42+
4343 // Check if we've already normalized this endpoint object
4444 if ( typeof endpoint === 'object' && endpoint !== null ) {
45- let cached = normalizedCache . get ( endpoint )
45+ const cached = normalizedCache . get ( endpoint )
4646 if ( cached ) return cached
47-
47+
4848 const normalized = {
4949 methods : endpoint . methods || [ 'GET' ] ,
5050 url : endpoint . url ,
5151 version : endpoint . version ,
5252 updateParams : endpoint . updateParams || false
5353 }
54-
54+
5555 // Cache the normalized form for future use
5656 normalizedCache . set ( endpoint , normalized )
5757 return normalized
5858 }
59-
59+
6060 return {
6161 methods : endpoint . methods || [ 'GET' ] ,
6262 url : endpoint . url ,
0 commit comments