mirror of
https://github.com/nullnyat/NullcatChan.git
synced 2025-08-06 01:03:52 +09:00
refactor
This commit is contained in:
16
src/utils/safe-for-interpolate.ts
Normal file
16
src/utils/safe-for-interpolate.ts
Normal file
@ -0,0 +1,16 @@
|
||||
const invalidChars = [
|
||||
'@',
|
||||
'#',
|
||||
'*',
|
||||
':',
|
||||
'(',
|
||||
')',
|
||||
'[',
|
||||
']',
|
||||
' ',
|
||||
' ',
|
||||
];
|
||||
|
||||
export function safeForInterpolate(text: string): boolean {
|
||||
return !invalidChars.some(c => text.includes(c));
|
||||
}
|
Reference in New Issue
Block a user