1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2024-12-16 01:10:30 +02:00

Add "path" key with raw path data to NPM package (#1472)

* Update prepublish script to add path to generated .js files

* Test generated path values

* Fix Furry Network icon

The Furry Network icon used to have "e"s in the path, however the 
official SVG definition does not specify the E command.

source: https://www.w3schools.com/graphics/svg_path.asp
This commit is contained in:
Eric Cornelissen 2019-06-15 21:31:23 +01:00 committed by Johan Fagerberg
parent b8d7649e7b
commit 30cd9ecc99
4 changed files with 12 additions and 1 deletions

View File

@ -1 +1 @@
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Furry Network icon</title><path d="m15.91 0c-3.122 0-6.218 0-9.313 0.027 0 0.055-0.054 0.055-0.082 0.082a10.508 10.508 0 0 0-3.665 2.567c-0.841 0.874-1.518 1.91-2.062 3.002-0.19 0.383-0.38 0.792-0.543 1.201-0.027 0.082-0.055 0.193-0.137 0.248v6.225c0.055 0.082 0.055 0.191 0.082 0.3 0.27 0.848 0.625 1.638 1.086 2.403 0.625 0.955 1.386 1.774 2.336 2.43 0.027 0.027 0.053 0.082 0.108 0.054-0.028-0.027-0.028-0.054-0.055-0.082-0.244-0.354-0.46-0.682-0.678-1.037-0.733-1.229-1.195-2.568-1.303-3.986-0.054-0.52-0.028-1.066 0.026-1.584 0.027-0.328 0.082-0.655 0.164-0.983 0.272-1.283 0.813-2.457 1.547-3.549a23.074 23.074 0 0 1 3.638-4.177 13.053 13.053 0 0 1 3.258-2.156c1.413-0.656 2.879-0.902 4.426-0.793 0.706 0.055 1.385 0.164 2.065 0.273 0.053 0 0.135 0.027 0.189 0.027 0.08 0.028 0.135 0.028 0.217 0.028-0.38-0.163-0.761-0.327-1.14-0.436-0.055-0.027-0.109-0.027-0.163-0.082zm-1.656 0.658c-0.436 0.027-0.843 0.053-1.277 0.135-0.733 0.137-1.44 0.356-2.145 0.574a7.475 7.475 0 0 0-1.438 0.627c-0.027 0-0.082 0-0.082 0.055h0.053a28.122 28.122 0 0 1 3.041-0.326c0.515-0.028 1.06-1e-3 1.576 0.08 0.76 0.11 1.466 0.383 2.118 0.765 1.927 1.12 3.42 2.677 4.398 4.698 0.814 1.72 1.249 3.547 1.385 5.431 0.054 0.655 0.054 1.339 0.027 2.022l-0.082 1.146c-0.028 0.328-0.08 0.655-0.135 0.983a6.098 6.098 0 0 1-0.273 1.173c-0.38 0.984-0.922 1.884-1.547 2.729-0.49 0.656-1.058 1.257-1.602 1.857-0.08 0.082-0.135 0.137-0.189 0.22 0.054 0 0.054-0.028 0.082-0.028a16.74 16.74 0 0 0 2.307-1.612c1.44-1.228 2.524-2.675 3.203-4.449l0.164-0.41h0.027v5.87c0 0.02 9e-3 -9.167 0.02-14.995-2e-3 0.02 0 0.042-0.02 0.063 0-0.028-0.027-0.057-0.027-0.084a10.75 10.75 0 0 0-1.52-2.729 9.702 9.702 0 0 0-3.123-2.648 9.763 9.763 0 0 0-4.941-1.147zm9.63 6.545c1e-3 -7e-3 9e-3 -0.014 9e-3 -0.021v-5.434c-8e-3 -0.11-4e-3 3.335-8e-3 5.455zm-13.012-3.332c-0.39-0.04-0.8 0.088-1.18 0.416a2.331 2.331 0 0 0-0.623 0.902c-0.326 0.792-0.38 1.583-0.217 2.403 0.109 0.628 0.406 1.173 0.922 1.582 0.516 0.437 1.113 0.493 1.656 0.193 0.326-0.191 0.57-0.437 0.76-0.766 0.326-0.572 0.463-1.2 0.463-1.855v-2e-3c0-0.3-0.028-0.573-0.082-0.873a2.8 2.8 0 0 0-0.625-1.393c-0.312-0.354-0.684-0.566-1.074-0.607zm5.133 1.283c-0.204 0-0.407 0.035-0.61 0.09-0.461 0.11-0.788 0.409-1.115 0.736-0.297 0.274-0.46 0.628-0.65 0.983a3.04 3.04 0 0 0-0.38 1.53h-1e-3c0 0.381 0.054 0.737 0.216 1.091 0.272 0.655 0.789 1.012 1.44 1.012 0.461 0 0.841-0.166 1.195-0.438 0.841-0.656 1.357-1.502 1.492-2.566 0.055-0.464 0-0.928-0.162-1.393-0.163-0.41-0.408-0.763-0.816-0.928a1.61 1.61 0 0 0-0.61-0.117zm-9.625 2.41c-0.435 0.028-0.842 0.19-1.114 0.6-0.353 0.491-0.462 1.066-0.488 1.639-0.028 0.6 0.109 1.147 0.38 1.666 0.218 0.436 0.515 0.818 0.923 1.092 0.516 0.354 1.169 0.354 1.63 0.027 0.272-0.191 0.462-0.465 0.596-0.766 0.272-0.627 0.327-1.31 0.164-1.992-0.163-0.738-0.488-1.365-1.058-1.857-0.299-0.245-0.626-0.408-1.033-0.408zm11.859 2.64a1.837 1.837 0 0 0-0.891 0.198c-0.869 0.41-1.466 1.066-1.819 1.967-0.19 0.519-0.272 1.037-0.109 1.584 0.136 0.491 0.407 0.847 0.897 0.983 0.19 0.055 0.408 0.082 0.597 0.082 0.326 0 0.543-0.03 0.815-0.166 0.516-0.246 0.922-0.6 1.275-1.036 0.57-0.737 0.815-1.556 0.625-2.457-0.109-0.6-0.461-0.983-1.086-1.12a1.873 1.873 0 0 0-0.304-0.036zm-7.109 1.646v2e-3c-0.081 0-0.216 0-0.351 0.027a3.581 3.581 0 0 0-1.495 0.408c-0.597 0.328-1.112 0.765-1.574 1.256a10.07 10.07 0 0 0-1.385 1.83c-0.217 0.381-0.352 0.792-0.326 1.229 0.027 0.245 0.028 0.464 0.137 0.681 0.298 0.384 0.704 0.657 1.193 0.766 0.462 0.082 0.924 0.027 1.385-0.027 0.515-0.055 1.004-0.11 1.492-0.082 0.789 0.054 1.495 0.3 2.12 0.79 0.244 0.192 0.46 0.411 0.732 0.602 0.516 0.355 1.06 0.518 1.684 0.381 0.515-0.109 0.869-0.437 0.976-0.955 0.11-0.438 0.082-0.847 0.027-1.283a9.464 9.464 0 0 0-0.378-1.502 9.946 9.946 0 0 0-1.006-2.266c-0.3-0.49-0.65-0.928-1.14-1.256-0.623-0.436-1.303-0.574-2.09-0.601zm-11.02 2.787v2.129c0.108 0.136 0.162 0.3 0.216 0.463 0.57 1.556 1.33 2.95 2.416 4.177 1.058 1.175 2.362 2.02 3.828 2.567 0.028 0 0.055 0.027 0.082 0.027h8.008c0.027-0.027 0.027-0.027 0.055-0.027a8.677 8.677 0 0 0 1.982-0.9c0.977-0.601 1.845-1.367 2.605-2.239 0.68-0.765 1.25-1.612 1.657-2.566 0.435-1.01 0.652-2.077 0.707-3.196a0.409 0.409 0 0 0 0-0.246c-0.028 0.028-0.055 0.055-0.055 0.082-0.082 0.246-0.136 0.464-0.217 0.71a8.29 8.29 0 0 1-1.873 3.195 8.081 8.081 0 0 1-2.851 1.91c-0.951 0.382-1.954 0.547-2.987 0.601-0.76 0.028-1.49 0-2.224-0.054a24.337 24.337 0 0 1-3.096-0.436 15.476 15.476 0 0 1-3.748-1.365c-1.303-0.71-2.417-1.584-3.313-2.758-0.489-0.628-0.921-1.31-1.193-2.074z"/></svg>
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Furry Network icon</title><path d="M15.91 0C12.79 0 9.69 0 6.6.03c0 .05-.06.05-.09.08a10.5 10.5 0 0 0-3.66 2.57c-.84.87-1.52 1.9-2.06 3-.2.38-.38.79-.55 1.2-.02.08-.05.2-.13.25v6.22c.05.08.05.2.08.3a8.66 8.66 0 0 0 3.42 4.83c.03.03.05.09.11.06-.03-.03-.03-.06-.06-.08-.24-.36-.46-.69-.67-1.04a9.1 9.1 0 0 1-1.28-5.57 10.09 10.09 0 0 1 1.71-4.53 23.07 23.07 0 0 1 3.64-4.18A13.05 13.05 0 0 1 10.32.98 8.82 8.82 0 0 1 14.74.2c.7.06 1.39.17 2.07.27L17 .5c.08.03.13.03.21.03-.38-.16-.76-.33-1.14-.44-.05-.02-.1-.02-.16-.08zm-1.66.66c-.43.02-.84.05-1.27.13-.74.14-1.44.36-2.15.58a7.47 7.47 0 0 0-1.44.62c-.02 0-.08 0-.08.06h.05a28.12 28.12 0 0 1 3.05-.33c.51-.03 1.06 0 1.57.08.76.11 1.47.39 2.12.77a10.8 10.8 0 0 1 4.4 4.7 15.14 15.14 0 0 1 1.38 5.43c.06.65.06 1.34.03 2.02l-.08 1.14c-.03.33-.08.66-.14.99a6.1 6.1 0 0 1-.27 1.17 11.7 11.7 0 0 1-1.55 2.73c-.49.66-1.05 1.26-1.6 1.86-.08.08-.13.13-.19.22.06 0 .06-.03.08-.03a16.74 16.74 0 0 0 2.31-1.61 10.87 10.87 0 0 0 3.2-4.45l.17-.41h.03v5.87c0 .02 0-9.17.02-15 0 .02 0 .05-.02.07l-.03-.09a10.75 10.75 0 0 0-1.52-2.73 9.7 9.7 0 0 0-3.12-2.64A9.76 9.76 0 0 0 14.25.66zm9.63 6.54l.01-.02V1.75 7.2zm-13-3.33c-.4-.04-.8.09-1.19.42a2.33 2.33 0 0 0-.62.9c-.33.8-.38 1.58-.22 2.4.11.63.4 1.18.92 1.58.52.44 1.12.5 1.66.2.33-.2.57-.44.76-.77.33-.57.46-1.2.46-1.85 0-.3-.02-.58-.08-.88a2.8 2.8 0 0 0-.62-1.4 1.69 1.69 0 0 0-1.08-.6zM16 5.15a2.38 2.38 0 0 0-1.72.83c-.3.27-.46.63-.65.98a3.04 3.04 0 0 0-.38 1.53c0 .38.05.74.21 1.1.28.65.8 1 1.44 1 .47 0 .85-.16 1.2-.43a3.75 3.75 0 0 0 1.5-2.57c.05-.46 0-.93-.17-1.4-.16-.4-.4-.75-.82-.92a1.61 1.61 0 0 0-.6-.12zM6.38 7.56c-.44.03-.84.2-1.11.6-.36.5-.47 1.07-.5 1.64-.02.6.12 1.15.39 1.67.22.43.51.82.92 1.1.52.34 1.17.34 1.63.02.27-.2.46-.47.6-.77.27-.63.32-1.3.16-1.99a3.3 3.3 0 0 0-1.06-1.86c-.3-.24-.62-.4-1.03-.4zm11.86 2.64a1.84 1.84 0 0 0-.9.2 3.5 3.5 0 0 0-1.81 1.97 2.44 2.44 0 0 0-.11 1.58c.14.5.4.85.9.99.19.05.4.08.6.08.32 0 .54-.03.8-.17.53-.24.93-.6 1.28-1.03a2.9 2.9 0 0 0 .63-2.46 1.3 1.3 0 0 0-1.09-1.12 1.87 1.87 0 0 0-.3-.04zm-7.11 1.65c-.08 0-.22 0-.35.03a3.58 3.58 0 0 0-1.5.4c-.6.34-1.1.77-1.57 1.26a10.07 10.07 0 0 0-1.39 1.83c-.21.38-.35.8-.32 1.23.03.25.03.47.14.68.3.39.7.66 1.19.77.46.08.92.03 1.38-.03.52-.05 1-.1 1.5-.08.78.05 1.5.3 2.12.79.24.2.46.41.73.6.51.36 1.06.52 1.68.38.52-.1.87-.43.98-.95.1-.44.08-.85.02-1.29a9.46 9.46 0 0 0-.37-1.5 9.95 9.95 0 0 0-1-2.26c-.3-.5-.66-.93-1.15-1.26a3.68 3.68 0 0 0-2.09-.6zM.11 14.64v2.13c.1.13.16.3.22.46a12.8 12.8 0 0 0 2.41 4.18 9.6 9.6 0 0 0 3.83 2.56c.03 0 .05.03.08.03h8.01c.03-.03.03-.03.05-.03a8.68 8.68 0 0 0 1.99-.9 11.4 11.4 0 0 0 4.26-4.8c.43-1.01.65-2.08.7-3.2a.4.4 0 0 0 0-.24c-.02.02-.05.05-.05.08l-.22.7a8.29 8.29 0 0 1-1.87 3.2 8.08 8.08 0 0 1-2.85 1.91c-.95.39-1.95.55-2.99.6-.76.03-1.49 0-2.22-.05a24.34 24.34 0 0 1-3.1-.44 15.48 15.48 0 0 1-3.75-1.36 10.15 10.15 0 0 1-3.3-2.76 7.5 7.5 0 0 1-1.2-2.07z"/></svg>

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -19,6 +19,7 @@ const icons = {};
data.icons.forEach(icon => {
const filename = titleToFilename(icon.title);
icon.svg = fs.readFileSync(`${iconsDir}/${filename}.svg`, "utf8");
icon.path = icon.svg.match(/<path\s+d="([^"]*)/)[1];
icons[icon.title] = icon;
// write the static .js file for the icon
fs.writeFileSync(

View File

@ -21,4 +21,9 @@ icons.forEach(icon => {
test(`${icon.title} has an "svg"`, () => {
expect(typeof subject.svg).toBe('string');
});
test(`${icon.title} has a "path"`, () => {
expect(typeof subject.path).toBe('string');
expect(subject.path).toMatch(/[MmZzLlHhVvCcSsQqTtAa0-9-,.\s]/g);
});
});

View File

@ -20,4 +20,9 @@ icons.forEach(icon => {
test(`${icon.title} has an "svg"`, () => {
expect(typeof subject.svg).toBe('string');
});
test(`${icon.title} has a "path"`, () => {
expect(typeof subject.path).toBe('string');
expect(subject.path).toMatch(/^[MmZzLlHhVvCcSsQqTtAa0-9-,.\s]+$/g);
});
});