NullcatChan/utils/safe-for-interpolate.ts
2022-09-18 00:16:06 +09:00

17 lines
202 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const invalidChars = [
'@',
'#',
'*',
':',
'(',
')',
'[',
']',
' ',
' ',
];
export function safeForInterpolate(text: string): boolean {
return !invalidChars.some(c => text.includes(c));
}