Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for(var cr=0;cr
console.log(jisho);
if (jisho.data.length > 0) {
var content = jisho.data[0];
var senses = JSON.stringify(content.senses[0].english_definitions).replace(/\"/g, '').replace(/,/g, '\n');
senses = senses.substring(1, senses.length - 1);
senses = senses.replace(/^/gm, '•\u2000');
senses = senses.replace(/\\/g, "")
const embed = new Discord.MessageEmbed()
.setAuthor(`${content.japanese[0].word ? content.japanese[0].word : content.japanese[0].reading}`)
.setThumbnail('https://a.safe.moe/FB0Qi.png')
.setColor('#9678D2')
.setDescription(content.is_common ? '`Common Word`' : '`Not a Common Word`' + `\n[External Link](https://jisho.org/search/${query})`)
.addField(`❯\u2000\Definition`, `${senses}`)
.addBlankField()
.addField(`❯\u2000\Reading`, `•\u2000**Kana:** ${content.japanese[0].reading ? content.japanese[0].reading : '`N/A`'}\n\•\u2000**Romāji:** ${wanakana.toRomaji(content.japanese[0].reading)}`);
return message.channel.send({ embed });
} else {
return message.channel.send(`No results found for **${query}**!`);
}
}
}
function normalize(arg: string): string {
return toRomaji(
arg.replace(/[A-Za-z0-9]/g, s =>
String.fromCharCode(s.charCodeAt(0) - 0xfee0)
)
);
}
public static kanaToRomaji (kana: string): string {
return toRomaji(kana)
}
for(var n1=0;n1" + options.delimiter_start + "<rt>" + wanakana.toKatakana(notations[n1][2]) + "</rt><rp>" + options.delimiter_end + "</rp>";
}
}
}
return result;
case 'romaji':
if(options.mode === 'okurigana')
for(var n2=0;n2" + options.delimiter_start + "<rt>" + wanakana.toRomaji(notations[n3][2]) + "</rt><rp>" + options.delimiter_end + "</rp>";
}
result += "";
}
return result;
case 'hiragana':
if(options.mode === 'okurigana'){
for(var n4=0;n4