feat: throw error if there is wrong field on siteConfig.js

This commit is contained in:
endiliey 2018-08-29 23:57:26 +08:00
parent ef17da741a
commit 9965eec798
4 changed files with 41 additions and 4 deletions

View file

@ -3,7 +3,7 @@ const chalk = require('chalk');
const escapeHtml = require('escape-html');
export default (str, rawLang) => {
if (rawLang === 'text') {
if (rawLang === 'text' || !rawLang) {
return escapeHtml(str);
}
const lang = rawLang.toLowerCase();