Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

379 B
Raw Blame
// `_` and `%` are wildcards to LIKE and ILIKE, and `\` is the escape character
// Postgres uses when no ESCAPE clause is given. A value compared with `ilike`
// has to go through here first, or a key holding one of them matches more rows
// than the one that was asked for.
export function escapeLikePattern(value: string): string {
  return value.replace(/[\\%_]/g, "\\$&");
}