Primitive full-text search on some properties of an object
You have a lot of code that is not needed.


The two continue are not needed.
Rather than assign the variable foundObjects the filtered result just return the result directly.
The variable val that holds the property can be side stepped.
Then the hasOwnProperty can be combined with the if statement
Rather than use the for loop you can also use Array.some to find if any item matches the search


Thus you get

export const search = &lt;T, K extends keyof T&gt;(term: string, objects: T[], keys: K[]): T[] =&gt; {
    return objects.filter(x =&gt; 
        keys.some(key =&gt; 
            x.hasOwnProperty(key) &amp;&amp; 
            typeof x[key] === 'string' &amp;&amp; 
            x[key].toLowerCase().includes(term)
        )
    );
};