This website requires JavaScript.
Explore
Help
Sign In
Madeorsk
/
rudeshark.net
Watch
1
Star
0
Fork
0
You've already forked rudeshark.net
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
91b1b5fb53
rudeshark.net
/
packages
/
backend
/
src
/
misc
/
sql-like-escape.ts
4 lines
83 B
TypeScript
Raw
Normal View
History
Unescape
Escape
(partially) cherry-picked from misskey/10e526b fix: Escape SQL LIKE * SQL LIKE escape * CHANGELOG
2023-01-08 12:32:17 +01:00
export
function
sqlLikeEscape
(
s
:
string
)
{
format
2023-05-07 02:46:07 +02:00
return
s
.
replace
(
/([%_])/g
,
"\\$1"
)
;
(partially) cherry-picked from misskey/10e526b fix: Escape SQL LIKE * SQL LIKE escape * CHANGELOG
2023-01-08 12:32:17 +01:00
}
Reference in New Issue
Copy Permalink