Refactor import.mjs to replace fs.readFileSync with readFileSync for improved consistency in SVG icon file reading.

This commit is contained in:
codecalm 2025-12-14 20:55:54 +01:00
parent af5ac46e7a
commit b26e778f5c
8 changed files with 123 additions and 1 deletions

View File

@ -64,7 +64,7 @@ types.forEach(type => {
}
if (existsSync(`./icons/${type}/${filename}.svg`)) {
const newFileData = fs.readFileSync(`./icons/${type}/${filename}.svg`).toString()
const newFileData = readFileSync(`./icons/${type}/${filename}.svg`).toString()
const m = newFileData.match(/(<!--.*-->)/gms)
if (m) {

View File

@ -0,0 +1,18 @@
<!--
-->
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M7 10h2a2 2 0 0 1 2 2v5h-3a2 2 0 1 1 0 -4h3" />
<path d="M16 7v10" />
<path d="M18 11l-4 2" />
<path d="M10.5 17a1.5 1.5 0 0 0 0 3" />
</svg>

After

Width:  |  Height:  |  Size: 369 B

View File

@ -0,0 +1,17 @@
<!--
-->
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M17 18v-12" />
<path d="M13 6l4 4l4 -4" />
<path d="M11 18l-7 -8l4 -4l4 4l-7 8" />
</svg>

After

Width:  |  Height:  |  Size: 315 B

19
icons/outline/blind.svg Normal file
View File

@ -0,0 +1,19 @@
<!--
-->
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M9 4a1 1 0 1 0 2 0a1 1 0 0 0 -2 0" />
<path d="M4 21l3 -4" />
<path d="M13 21l-2 -4l-3 -3l1 -6" />
<path d="M3 12l2 -3l4 -1l6 4" />
<path d="M16.5 14l3.5 7" />
</svg>

After

Width:  |  Height:  |  Size: 396 B

View File

@ -0,0 +1,16 @@
<!--
category: Brand
-->
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M20 12l-12 6.75m12 -6.75l-12 -6.75m12 6.75v-4.527l-8 -4.473l-4 2.25m12 6.75v4.5l-8 4.5l-4 -2.25m0 -13.5l-4 2.222v9.028l4 2.25z" />
</svg>

After

Width:  |  Height:  |  Size: 375 B

18
icons/outline/deaf.svg Normal file
View File

@ -0,0 +1,18 @@
<!--
-->
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M6 10a7 7 0 1 1 13 3.6a10 10 0 0 1 -2 2a8 8 0 0 0 -2 3a4.5 4.5 0 0 1 -6.8 1.4" />
<path d="M10 10a3 3 0 1 1 5 2.2" />
<path d="M5 13l4 4" />
<path d="M9 13l-4 4" />
</svg>

After

Width:  |  Height:  |  Size: 399 B

View File

@ -0,0 +1,18 @@
<!--
-->
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065" />
<path d="M9 14v-2.5a1.5 1.5 0 0 1 3 0v2.5" />
<path d="M9 13h3" />
<path d="M15 10v4" />
</svg>

After

Width:  |  Height:  |  Size: 850 B

View File

@ -0,0 +1,16 @@
<!--
-->
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M13 7a9.3 9.3 0 0 0 1.516 -.546c.911 -.438 1.494 -1.015 1.937 -1.932c.207 -.428 .382 -.928 .547 -1.522c.165 .595 .34 1.095 .547 1.521c.443 .918 1.026 1.495 1.937 1.933c.426 .205 .925 .38 1.516 .546a9.3 9.3 0 0 0 -1.516 .547c-.911 .438 -1.494 1.015 -1.937 1.932a9 9 0 0 0 -.547 1.521c-.165 -.594 -.34 -1.095 -.547 -1.521c-.443 -.918 -1.026 -1.494 -1.937 -1.932a9 9 0 0 0 -1.516 -.547" />
<path d="M3 14a21 21 0 0 0 1.652 -.532c2.542 -.953 3.853 -2.238 4.816 -4.806a20 20 0 0 0 .532 -1.662a20 20 0 0 0 .532 1.662c.963 2.567 2.275 3.853 4.816 4.806q .75 .28 1.652 .532a21 21 0 0 0 -1.652 .532c-2.542 .953 -3.854 2.238 -4.816 4.806a20 20 0 0 0 -.532 1.662a20 20 0 0 0 -.532 -1.662c-.963 -2.568 -2.275 -3.853 -4.816 -4.806a21 21 0 0 0 -1.652 -.532" />
</svg>

After

Width:  |  Height:  |  Size: 977 B