mirror of
https://github.com/nullnyat/NullcatChan.git
synced 2025-04-29 08:47:21 +09:00
11 lines
344 B
TypeScript
11 lines
344 B
TypeScript
import { hiraganaToKatagana, zenkakuToHankaku, hankakuToZenkaku } from './japanese';
|
|
|
|
export default function(text: string, words: string[]): boolean {
|
|
if (text == null) return false;
|
|
|
|
text = hankakuToZenkaku(hiraganaToKatagana(text));
|
|
words = words.map(word => hiraganaToKatagana(word));
|
|
|
|
return words.some(word => text.includes(word));
|
|
}
|