rudeshark.net/packages/backend/src/misc/sql-like-escape.ts

4 lines
83 B
TypeScript
Raw Normal View History

export function sqlLikeEscape(s: string) {
2023-05-07 02:46:07 +02:00
return s.replace(/([%_])/g, "\\$1");
}