monkeeShark/packages/backend/src/misc/sql-like-escape.ts
MeiMei 10e526ba56
fix: Escape SQL LIKE (#9493)
* SQL LIKE escape

* CHANGELOG
2023-01-08 20:32:17 +09:00

3 lines
83 B
TypeScript

export function sqlLikeEscape(s: string) {
return s.replace(/([%_])/g, '\\$1');
}