1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
diff --git a/index.ts b/index.ts
index e9ffa167273d727074954319a395e6dcd8fc4212..062f0ad82a08c00fbadf1fbac8c1fe006c016d10 100644
--- a/index.ts
+++ b/index.ts
@@ -1,21 +1,21 @@
-import * as icons from 'simple-icons';
+import * as icons from "simple-icons";
let structs = "";
let map = "";
-for (const [name, icon] of Object.entries(icons)) {
- const varName = "SI" + icon.slug.charAt(0).toUpperCase() + icon.slug.slice(1);
+for (const [_name, icon] of Object.entries(icons)) {
+ const varName = "SI" + icon.slug.charAt(0).toUpperCase() + icon.slug.slice(1);
structs += varName + ` = Icon{
Title: "${icon.title}",
Slug: "${icon.slug}",
Hex: "${icon.hex}",
Path: "${icon.path}",
}
- `
+ `;
map += `"${icon.slug}": ${varName},
- `
+ `;
}
-let tmpl = `package simpleicons
+const tmpl = `package simpleicons
import "fmt"
@@ -29,7 +29,9 @@ }
// SVG returns a complete SVG for the Icon
func (i Icon) SVG() string {
- return fmt.Sprintf(` + "`" + `<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>%s</title><path d="%s"/></svg>` + "`" + `, i.Title, i.Path)
+ return fmt.Sprintf(` + "`" +
+ `<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>%s</title><path d="%s"/></svg>` +
+ "`" + `, i.Title, i.Path)
}
var (
@@ -38,6 +40,6 @@ Icons = map[string]Icon{
${map}
}
)
-`
+`;
const path = "./simpleicons.go";
-await Bun.write(path, tmpl);
+await Deno.writeTextFile(path, tmpl);
|