import type { QueryCacheKey } from './core/apiState' ; import type { EndpointDefinition } from './endpointDefinitions' ; import { isPlainObject } from '@reduxjs/toolkit' ; export const defaultSerializeQueryArgs = ( { endpointName , queryArgs , } ) => { return `${ endpointName }(${ JSON . stringify ( queryArgs , ( key , value ) => isPlainObject ( value ) ? Object . keys ( value ) . sort ( ) . reduce < any > ( ( acc , key ) => { acc [ key ] = ( value as any ) [ key ] ; return acc ; } , { } ) : value ) })` ; } ; export type SerializeQueryArgs < QueryArgs > = ( _ : { queryArgs : QueryArgs ; endpointDefinition : EndpointDefinition < any , any , any , any > ; endpointName : string ; } ) => string ; export type InternalSerializeQueryArgs = ( _ : { queryArgs : any ; endpointDefinition : EndpointDefinition < any , any , any , any > ; endpointName : string ; } ) => QueryCacheKey ;