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

@@ -79,13 +79,17 @@ ${(Object.keys(meta) as Array<keyof UserScriptMetaFull>)
: key
key_str = key_str.padEnd(12, ' ')
if (typeof val === 'boolean') { //bool
if (typeof val === 'boolean') {
//bool
if (val) return `// @${key_str}`
} else if (typeof val === 'string') { //string
} else if (typeof val === 'string') {
//string
return `// @${key_str} ${val}`
} else if (Array.isArray(val)) { //multiple
} else if (Array.isArray(val)) {
//multiple
return val.map(v => `// @${key_str} ${v}`).join('\n')
} else if (typeof val === 'object') { //multilingual
} else if (typeof val === 'object') {
//multilingual
let langs = val
return Object.keys(langs)
.map(lang => {

View File

@@ -1,7 +1,9 @@
export type UserScriptMetaMultilingual = string | {
default: string
[lang: string]: string
}
export type UserScriptMetaMultilingual =
| string
| {
default: string
[lang: string]: string
}
export type UserScriptMetaMultiple = string | string[]
export interface UserScriptMetaPartial {