built previous commit

This commit is contained in:
2022-06-10 21:55:42 -05:00
parent 85ff5851b5
commit a10a35d662
7 changed files with 30 additions and 25 deletions

View File

@@ -71,15 +71,28 @@ ${Object.keys(meta)
: key;
key_str = key_str.padEnd(12, ' ');
if (typeof val === 'boolean') {
//bool
if (val)
return `// @${key_str}`;
}
else if (typeof val === 'string') {
//string
return `// @${key_str} ${val}`;
}
else if (Array.isArray(val)) {
//multiple
return val.map(v => `// @${key_str} ${v}`).join('\n');
}
else if (typeof val === 'object') {
//multilingual
let langs = val;
return Object.keys(langs)
.map(lang => {
let langStr = lang === 'default' ? '' : `:${lang}`;
return `// @${key_str}${langStr} ${langs[lang]}`;
})
.join('\n');
}
return '';
})
.filter(l => l.length)