Escaping strings when passing to wire:click event

I have a wire:click defined as: wire:click="sendString('{{ $search }}', 'example')" where example is a fixed parameter and $search is dynamic based on a wire:model somewhere else on the page.

The problem is if the user uses single or double quotes. For instance if they input *didn’t( then I’ll get SyntaxError: Unexpected identifier 't'. Expected ')' to end an argument list.

I’m not sure if/how I can use javascript’s unescape() in this case?