SQL LIKE search in Angular filter objects
I think you inverted startLike with endLike.

const like = format.indexOf("%") &gt;= 0;
const startLike = like &amp;&amp; format.charAt(0) === "%";
const endLike = like &amp;&amp; format.charAt(format.length - 1) === "%";


When I read startLike I could misunderstand with startWith, that is the popular term used in APIs.

So it's complicated to read the code, as you work with an inverted logic.

I will use startWith(== endLike) and endWith (== startLike), instead.

Another point about naming is:

const split = [];


I think it is meaningless and a very bad choice for an array name.

Consider the case in a future time if you need to use Array.split():

split.split(...);


Not so good in readability.

Consider the code:

const split = [];

split.splice(0, 0, ...format.split("%"));


Not sure why you want to do all this work to just assign an array.

You could just use:

const split = format.split("%");