update icons.js

This commit is contained in:
sam 2023-09-20 02:29:06 +02:00
parent bb64378c13
commit f424228fee
No known key found for this signature in database
GPG Key ID: B4EF20DDE721CAA1
2 changed files with 1960 additions and 1968 deletions

File diff suppressed because it is too large Load Diff

View File

@ -16,26 +16,22 @@ writeFileSync("src/icons.ts", `const icons = ${output};\nexport default icons;`)
const goCode1 = `// Generated code. DO NOT EDIT const goCode1 = `// Generated code. DO NOT EDIT
package icons package icons
var icons = [...]string{ var icons = map[string]struct{}{
`; `;
const goCode2 = `} const goCode2 = `}
// IsValid returns true if the input is the name of a Bootstrap icon. // IsValid returns true if the input is the name of a Bootstrap icon.
func IsValid(name string) bool { func IsValid(name string) bool {
for i := range icons { _, ok := icons[name]
if icons[i] == name { return ok
return true
}
}
return false
} }
`; `;
let goOutput = goCode1; let goOutput = goCode1;
keys.forEach((element) => { keys.forEach((element) => {
goOutput += ` "${element}",\n`; goOutput += ` "${element}": {},\n`;
}); });
goOutput += goCode2; goOutput += goCode2;