This website requires JavaScript.
Explore
Help
Sign In
natty
/
calckey
Watch
1
Star
0
Fork
You've already forked calckey
0
Code
Issues
1
Pull Requests
Packages
Projects
Releases
Wiki
Activity
544e3a008e
calckey
/
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 11:32:17 +00:00
export
function
sqlLikeEscape
(
s
:
string
)
{
format
2023-05-07 00:46:07 +00:00
return
s
.
replace
(
/([%_])/g
,
"\\$1"
)
;
(partially) cherry-picked from misskey/10e526b fix: Escape SQL LIKE * SQL LIKE escape * CHANGELOG
2023-01-08 11:32:17 +00:00
}