getCategory

fun getCategory(categoryResponse: List<CategoryResponse>?, params: CategoryParams): Category?

Extracts a category from a list of category responses based on the provided parameters.

This method processes the categoryResponse list to find a matching category based on the URL in params. It distinguishes between major and minor categories using URL patterns and returns a Category object if a match is found.

Return

The extracted Category, or null if no match is found or the response is null.

Parameters

categoryResponse

The list of category responses from the API.

params

The parameters including the category URL and other criteria.