Cookiebot issue with aggregated js files

Cookiebot auto-blocking mode is not compatible with Drupals JS aggregation as soon as an aggregated file contains the word "cookie", even if it is for removing a cookie, the whole aggregated script is blocked and leads to JS errors like "jQuery is undefined".
We certainly can add addtional attributes to the library files and custom js files, but not for aggregated (in a simple way).
I found really dirty solution how to achieve this result. 

Views filter field search without spaces (drupal 8)

The issue related to the custom website with custom field for phone. It has spaces. One of the solution is to remove spaces on presave and process the old entries in DB removing the spaces.
But sometimes it better not to touch thing that works.
The task was to provide search by phone filter in views. There are no default methods in views to search with removed spaces. In this case I've found a solution to alter the query.
So for example the phone fields value is "+354 566 32 56" and we need to find it by searching "6632" string.
This code will help you with it: