NullcatChan/src/utils/safe-for-interpolate.ts
2023-01-29 17:39:28 +09:00

6 lines
189 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));
}