update icons.js
This commit is contained in:
parent
bb64378c13
commit
f424228fee
File diff suppressed because it is too large
Load Diff
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue