1
0
mirror of https://github.com/svg/svgo.git synced 2026-01-27 07:02:06 +03:00
Commit Graph

21 Commits

Author SHA1 Message Date
Seth Falco
747cc722d9 chore: revamp how we export types (#2118) 2025-05-04 17:39:44 +01:00
Seth Falco
49954bc0d9 chores: various clean ups regardin ESM and TypeScript (#2117) 2025-05-03 09:42:29 +01:00
Seth Falco
97079fb57e chore: refactor stringifier.js (#2115) 2025-05-01 23:24:24 +01:00
Seth Falco
8c593fab06 chore: bulk update all jsdoc and jsdoctypes (#2114) 2025-05-01 22:16:52 +01:00
Seth Falco
b8f8d1c655 refactor: dont covert to charcode in iswhitespace (#2039) 2024-06-16 13:02:53 +01:00
johnkenny54
473c5a603e fix: stringifyPathData needs space before scientific notation (#1961) 2024-02-25 22:22:01 +00:00
Jon Dufresne
2442f74239 chore: convert project to us ECMAScript modules (preserving CJS compatibility) (#1905) 2024-01-03 16:17:37 +00:00
Seth Falco
2661dacc24 fix(convertTransform): fix scale and rotate on skew + refactors (#1916) 2023-12-31 00:59:18 +00:00
Seth Falco
c2cacc7060 chore: move health files to .github (#1906) 2023-12-27 12:54:30 +00:00
Seth Falco
6996fca1a6 refactor: improve performance of stringifyPathData (#1900) 2023-12-24 23:05:12 +00:00
Jon Dufresne
d6ff70baf9 chore: fix several typos (#1868) 2023-12-03 18:02:22 +00:00
Seth Falco
1df2e0fa39 fix(cleanupIds): skip generated ids for malformed references (#1817)
I also had some chores pending which were trivial individually, I opted
to incorporate them here as well.

* In JSDocs, use the nullable syntax as it's more concise and familiar
from TypeScript usage.
* discord → Discord (proper nouns should match capitalization)
* Use actions/checkout v4 instead of v2
2023-11-04 12:56:20 +00:00
Marvin Hagemeister
aa5d667fcb Speed up stringifyNumber (#1717)
I'm currently profiling my build setup and noticed that
`stringifyNumber` pops up here and there. Instead of going with the
double regex replace approach, we'll go with the faster approach in
`removeLeadingZero`.

In total the changes in this PR speed up the build by about `0.9s` in my
project.

<img width="798" alt="stringifyNumber"
src="https://user-images.githubusercontent.com/1062408/204154146-ce67d0c9-faf2-40a1-8186-8d34caea74a5.png">
2022-11-30 11:53:51 +03:00
Bogdan Chadkin
e4918ccdd1 Covert removeHiddenElems with types (#1532)
Covered removeHiddenElems plugin and big part of our code
- path parser and stringifier
- style manager
2021-08-21 14:55:05 +03:00
Josep del Rio
454b4277a3 Remove flag spaces for all arcs (#1484)
Ref #1476

The issue is that a path command may have multiple arcs, and the space optimization was only applied to the first one. Modified a test to check it.


Co-authored-by: Josep del Río <joseprio@fb.com>
Co-authored-by: Bogdan Chadkin <trysound@yandex.ru>
2021-08-12 21:51:26 +03:00
Bogdan Chadkin
3d4adb6b04 Simplify number rendering and fix -0 in path
Ref https://github.com/svg/svgo/issues/1422
2021-03-22 14:38:06 +03:00
Sebastian Kreft
76c7719604 chore: Improve TS config (#1405)
Changed the TS config file to include all relevant folders and explicitly exclude those files that fail the type checks. In this way new files will be automatically type checked and we can see the list of files that need types improvements.

In this pass I also fixed some js files.
2021-03-05 01:17:44 +03:00
Bogdan Chadkin
0e02fd9fde Fix noSpaceAfterFlags support 2021-03-04 13:15:36 +03:00
Bogdan Chadkin
d6f972c970 Fix scientific notation parsing in paths 2021-03-02 11:49:54 +03:00
Bogdan Chadkin
04b2ae9a37 Implement path stringify (#1387)
Ref https://github.com/svg/svgo/issues/32

Added `stringifyPathData` utility to produce small as possible path by
- matching leading moveto and line to commands (m -> l, M -> L)
- combining moveto and lineto commands
- avoiding space before decimal numbers if possible
2021-03-02 01:07:26 +03:00
Bogdan Chadkin
4086e31334 Implement new path parser (#1378)
Regexps are quite leaky for complex parsing. Regression tests caught
a few issues related to path parser.

In this diff I implemented the new spec-compliant parser which solves
2 regression cases and covers many edge cases hard to handle with
regexps.
2021-02-28 22:10:57 +03:00