javascript – refactoring to make it simple without much if

I have this piece of code in my nodejs repository.
The criteria are huge, but I have shortened it so that the question remains simple.
there are many conditions if, what I do not really like … ask me what is the best way to rephrase it more simply and more directly

const {
a,
b
} = criteria;

const bindings = {a: `$ {a}`};


if b! == & # 39;) {
bindings.b = `$ {b}%`;
}

.... if the conditions persist according to the long criteria, I pass these parts to shorten the question
..
...



const optionalWhere = `
$ {(b! == & # 39;))? & # 39; AND b LIKE: b & # 39;
`;

const result = wait this.knex.raw (`SELECT blah blah
O a =: a
$ {optionalWhere}
`, bindings);