iceshrimp-161sh/packages/backend/src/misc/sql-like-escape.ts
2023-05-07 09:46:07 +09:00

4 lines
83 B
TypeScript

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