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
package icons
var icons = [...]string{
var icons = map[string]struct{}{
`;
const goCode2 = `}
// IsValid returns true if the input is the name of a Bootstrap icon.
func IsValid(name string) bool {
for i := range icons {
if icons[i] == name {
return true
}
}
return false
_, ok := icons[name]
return ok
}
`;
let goOutput = goCode1;
keys.forEach((element) => {
goOutput += ` "${element}",\n`;
goOutput += ` "${element}": {},\n`;
});
goOutput += goCode2;