1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-19 00:58:54 +09:00
MisskeyIO/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

4 lines
83 B
TypeScript

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