{"_id":"@amandaghassaei/flat-svg","_rev":"10-ac037280da6bfa867d0de2faa0df5c0a","name":"@amandaghassaei/flat-svg","dist-tags":{"latest":"2.0.5"},"versions":{"1.0.0":{"name":"@amandaghassaei/flat-svg","version":"1.0.0","keywords":["svg","flat","flatten","flattener","ungroup","path","shape","transform","style","parse","element","split","segment","filter"],"author":{"name":"Amanda Ghassaei"},"license":"MIT","_id":"@amandaghassaei/flat-svg@1.0.0","maintainers":[{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"}],"homepage":"https://apps.amandaghassaei.com/flat-svg/demo/","bugs":{"url":"https://github.com/amandaghassaei/flat-svg/issues"},"dist":{"shasum":"ed7ec9e6c71de4d2dc23740d1fd4de8cfd88410a","tarball":"https://registry.npmjs.org/@amandaghassaei/flat-svg/-/flat-svg-1.0.0.tgz","fileCount":31,"integrity":"sha512-Vkg9yKG9Nhz59Nx3aoRQ4GkHPgvazJC3vd1HE4ei42Qd7VNl5c2nivoBXP7Y3F6ohE/ILnbcrRvyh+sqjm2nqA==","signatures":[{"sig":"MEUCICRkyyumwdRr+++DYplebaAU6haOGcaMnL59GQ7Q0Vr2AiEAw38FfvdX74+Awx6CHnpURDhk07BEXt6AbY0vgoRABIA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":209218},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"9158909af647fc2595921b54e49972b2c1ca7460","scripts":{"docs":"typedoc --options ./typedoc.json","test":"mocha 'test/**/*.ts'","build":"rollup --config && tsc && npm run docs && npm run make-coverage-badge","serve":"http-server -p 8080 -c-1","test-with-coverage":"c8 mocha 'test/**/*.ts'","make-coverage-badge":"c8 --reporter=json-summary mocha 'test/**/*.ts' && coverage-badge-creator"},"_npmUser":{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"},"repository":{"url":"git+https://github.com/amandaghassaei/flat-svg.git","type":"git"},"_npmVersion":"10.2.3","description":"A TypeScript library for converting nested SVGs into a flat list of elements, paths, or segments and applying style-based filters.","directories":{},"_nodeVersion":"21.2.0","dependencies":{"colord":"^2.9.3","svgpath":"^2.6.0","svg-parser":"^2.0.4","@adobe/css-tools":"^4.3.0-rc.1","@amandaghassaei/type-checks":"^1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.0","tsx":"^4.19.3","chai":"^4.3.6","mocha":"^9.2.2","tslib":"^2.4.1","rollup":"^2.70.2","typedoc":"^0.23.14","@types/css":"0.0.33","typescript":"^4.6.4","@types/chai":"^4.3.4","http-server":"^14.1.1","@types/mocha":"^10.0.1","@types/svg-parser":"^2.0.3","rollup-plugin-dts":"^4.2.3","rollup-plugin-delete":"^2.0.0","rollup-plugin-terser":"^7.0.2","coverage-badge-creator":"^1.0.17","@rollup/plugin-commonjs":"^22.0.0","typedoc-plugin-markdown":"^3.13.6","@rollup/plugin-typescript":"^9.0.2","@rollup/plugin-node-resolve":"^13.2.1","rollup-plugin-polyfill-node":"^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/flat-svg_1.0.0_1740597563893_0.7203644799834612","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@amandaghassaei/flat-svg","version":"1.0.1","keywords":["svg","flat","flatten","flattener","ungroup","path","shape","transform","style","parse","element","split","segment","filter"],"author":{"name":"Amanda Ghassaei"},"license":"MIT","_id":"@amandaghassaei/flat-svg@1.0.1","maintainers":[{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"}],"homepage":"https://apps.amandaghassaei.com/flat-svg/demo/","bugs":{"url":"https://github.com/amandaghassaei/flat-svg/issues"},"dist":{"shasum":"83f6293a3a724e35036ac608200badee0c061214","tarball":"https://registry.npmjs.org/@amandaghassaei/flat-svg/-/flat-svg-1.0.1.tgz","fileCount":31,"integrity":"sha512-PJxBHzPn1jDQA3zABP+7IbBbL4HcruXUP49tOUgSBcUMOsN68vgn0/Rea7its5rOTa/KHMNfw0SHfXqmWiFcHw==","signatures":[{"sig":"MEYCIQDB45NP0mVhnCRHjURCf8JexTxuKKlu/7WqrgaswVvHYQIhAJmcC2uZpbj6KWe+OE7uAB+1aVHlrAq1zp+WXb+WWHz7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":209218},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"bb1cde5a4cd25d420ae3c78d3080272c92ca5cd6","scripts":{"docs":"typedoc --options ./typedoc.json","test":"mocha 'test/**/*.ts'","build":"rollup --config && tsc && npm run docs && npm run make-coverage-badge","serve":"http-server -p 8080 -c-1","test-with-coverage":"c8 mocha 'test/**/*.ts'","make-coverage-badge":"c8 --reporter=json-summary mocha 'test/**/*.ts' && coverage-badge-creator"},"_npmUser":{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"},"repository":{"url":"git+https://github.com/amandaghassaei/flat-svg.git","type":"git"},"_npmVersion":"10.2.3","description":"A TypeScript library for converting nested SVGs into a flat list of elements, paths, or segments and applying style-based filters.","directories":{},"_nodeVersion":"21.2.0","dependencies":{"colord":"^2.9.3","svgpath":"^2.6.0","svg-parser":"^2.0.4","@adobe/css-tools":"^4.3.0-rc.1","@amandaghassaei/type-checks":"^1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.0","tsx":"^4.19.3","chai":"^4.3.6","mocha":"^9.2.2","tslib":"^2.4.1","rollup":"^2.70.2","typedoc":"^0.23.14","@types/css":"0.0.33","typescript":"^4.6.4","@types/chai":"^4.3.4","http-server":"^14.1.1","@types/mocha":"^10.0.1","@types/svg-parser":"^2.0.3","rollup-plugin-dts":"^4.2.3","rollup-plugin-delete":"^2.0.0","rollup-plugin-terser":"^7.0.2","coverage-badge-creator":"^1.0.17","@rollup/plugin-commonjs":"^22.0.0","typedoc-plugin-markdown":"^3.13.6","@rollup/plugin-typescript":"^9.0.2","@rollup/plugin-node-resolve":"^13.2.1","rollup-plugin-polyfill-node":"^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/flat-svg_1.0.1_1740597608410_0.4349485562178257","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@amandaghassaei/flat-svg","version":"1.0.2","keywords":["svg","flat","flatten","flattener","ungroup","path","shape","transform","style","parse","element","split","segment","filter"],"author":{"name":"Amanda Ghassaei"},"license":"MIT","_id":"@amandaghassaei/flat-svg@1.0.2","maintainers":[{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"}],"homepage":"https://apps.amandaghassaei.com/flat-svg/demo/","bugs":{"url":"https://github.com/amandaghassaei/flat-svg/issues"},"dist":{"shasum":"65227ca02f0985cfb7e17ba70d434e20eb38709f","tarball":"https://registry.npmjs.org/@amandaghassaei/flat-svg/-/flat-svg-1.0.2.tgz","fileCount":31,"integrity":"sha512-BffaGLgVo0jVwQn10DdZztR1GxzkOCJWRrFaWHzMJ3/3j+6YnuGH7gHgDSGfnuPsVbbxUGBdtNO/aGBPIgsalQ==","signatures":[{"sig":"MEQCIGlYkaeJJE59fcZCKIIje0RnvvV75BS/FrflEAGyj1TRAiBpxyfAHPZASgj4ja64BdfC99kg7YrDTD0xFXagvO3xUg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":209000},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"69db4602cb8fcd39d872d804780b59ae73f349a7","scripts":{"docs":"typedoc --options ./typedoc.json","test":"mocha 'test/**/*.ts'","build":"rollup --config && tsc && npm run docs && npm run make-coverage-badge","serve":"http-server -p 8080 -c-1","test-with-coverage":"c8 mocha 'test/**/*.ts'","make-coverage-badge":"c8 --reporter=json-summary mocha 'test/**/*.ts' && coverage-badge-creator"},"_npmUser":{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"},"repository":{"url":"git+https://github.com/amandaghassaei/flat-svg.git","type":"git"},"_npmVersion":"10.2.3","description":"A TypeScript library for converting nested SVGs into a flat list of elements, paths, or segments and applying style-based filters.","directories":{},"_nodeVersion":"21.2.0","dependencies":{"colord":"^2.9.3","svgpath":"^2.6.0","svg-parser":"^2.0.4","@adobe/css-tools":"^4.3.0-rc.1","@amandaghassaei/type-checks":"^1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.0","tsx":"^4.19.3","chai":"^4.3.6","mocha":"^9.2.2","tslib":"^2.4.1","rollup":"^2.70.2","typedoc":"^0.23.14","@types/css":"0.0.33","typescript":"^4.6.4","@types/chai":"^4.3.4","http-server":"^14.1.1","@types/mocha":"^10.0.1","@types/svg-parser":"^2.0.3","rollup-plugin-dts":"^4.2.3","rollup-plugin-delete":"^2.0.0","rollup-plugin-terser":"^7.0.2","coverage-badge-creator":"^1.0.17","@rollup/plugin-commonjs":"^22.0.0","typedoc-plugin-markdown":"^3.13.6","@rollup/plugin-typescript":"^9.0.2","@rollup/plugin-node-resolve":"^13.2.1","rollup-plugin-polyfill-node":"^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/flat-svg_1.0.2_1740598155321_0.7512385010446248","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@amandaghassaei/flat-svg","version":"1.0.3","keywords":["svg","flat","flatten","flattener","ungroup","path","shape","transform","style","parse","element","split","segment","filter"],"author":{"name":"Amanda Ghassaei"},"license":"MIT","_id":"@amandaghassaei/flat-svg@1.0.3","maintainers":[{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"}],"homepage":"https://apps.amandaghassaei.com/flat-svg/demo/","bugs":{"url":"https://github.com/amandaghassaei/flat-svg/issues"},"dist":{"shasum":"a50c375ebfa02740cb28c22b52c9a1542f029be1","tarball":"https://registry.npmjs.org/@amandaghassaei/flat-svg/-/flat-svg-1.0.3.tgz","fileCount":31,"integrity":"sha512-YVfxaRogMOM0FXzeZr0kQcwzZKXVUDoAc6YL0PVF42fplhHPocZpcL6mcgbmcfdek8cOIx9aa1lwzVUQlBdHSw==","signatures":[{"sig":"MEUCIAEdpr5KJVuo1K1gsHwqA8XvZ4zsJiWgMcb0Q2HyN1ZHAiEArBvb9uakfd9J4qd91m/aZf6mvQg1Gxf4LV8cx8Si+UA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":210185},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"7ee8da85712f7caa4dcd6ec1d77795bf58425be8","scripts":{"docs":"typedoc --options ./typedoc.json","test":"mocha 'test/**/*.ts'","build":"rollup --config && tsc && npm run docs && npm run make-coverage-badge","serve":"http-server -p 8080 -c-1","test-with-coverage":"c8 mocha 'test/**/*.ts'","make-coverage-badge":"c8 --reporter=json-summary mocha 'test/**/*.ts' && coverage-badge-creator"},"_npmUser":{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"},"repository":{"url":"git+https://github.com/amandaghassaei/flat-svg.git","type":"git"},"_npmVersion":"10.2.3","description":"A TypeScript library for converting nested SVGs into a flat list of elements, paths, or segments and applying style-based filters.","directories":{},"_nodeVersion":"21.2.0","dependencies":{"colord":"^2.9.3","svgpath":"^2.6.0","svg-parser":"^2.0.4","@adobe/css-tools":"^4.3.0-rc.1","@amandaghassaei/type-checks":"^1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.0","tsx":"^4.19.3","chai":"^4.3.6","mocha":"^9.2.2","tslib":"^2.4.1","rollup":"^2.70.2","typedoc":"^0.23.14","@types/css":"0.0.33","typescript":"^4.6.4","@types/chai":"^4.3.4","http-server":"^14.1.1","@types/mocha":"^10.0.1","@types/svg-parser":"^2.0.3","rollup-plugin-dts":"^4.2.3","rollup-plugin-delete":"^2.0.0","rollup-plugin-terser":"^7.0.2","coverage-badge-creator":"^1.0.17","@rollup/plugin-commonjs":"^22.0.0","typedoc-plugin-markdown":"^3.13.6","@rollup/plugin-typescript":"^9.0.2","@rollup/plugin-node-resolve":"^13.2.1","rollup-plugin-polyfill-node":"^0.11.0"},"_npmOperationalInternal":{"tmp":"tmp/flat-svg_1.0.3_1745450222819_0.6552071373996411","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@amandaghassaei/flat-svg","version":"2.0.0","keywords":["svg","flat","flatten","flattener","ungroup","path","shape","transform","style","parse","element","split","segment","filter"],"author":{"name":"Amanda Ghassaei"},"license":"MIT","_id":"@amandaghassaei/flat-svg@2.0.0","maintainers":[{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"}],"homepage":"https://apps.amandaghassaei.com/flat-svg/demo/","bugs":{"url":"https://github.com/amandaghassaei/flat-svg/issues"},"dist":{"shasum":"61451191648e4243f8b82a620df4a58be15f06b5","tarball":"https://registry.npmjs.org/@amandaghassaei/flat-svg/-/flat-svg-2.0.0.tgz","fileCount":45,"integrity":"sha512-hZK7OnqrP+vR9pJRO3p7C8vsgcT8q5OMTmMAz4rBY8cbOijjtqc5aB/uOi1o0Co1E4Z9d8U0S5zzoKTWSb73tg==","signatures":[{"sig":"MEYCIQC9tGWa1JKZ0orkSL4z2xq1wlzH4dgDApGiQdd1ZEhvkQIhAL+dbCztCjtSD3nvTe5GLYraSgzHz+RZQTSixNEmKvjO","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":394356},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"c2f7caed849d699fee1c594ebab3f0b8a83dcc6f","scripts":{"docs":"typedoc --options ./typedoc.json","test":"mocha 'test/**/*.ts'","build":"rollup --config && tsc -p tsconfig.build.json && npm run docs && npm run make-coverage-badge","serve":"http-server -p 8080 -c-1","test-with-coverage":"c8 mocha 'test/**/*.ts'","make-coverage-badge":"c8 --reporter=json-summary mocha 'test/**/*.ts' && coverage-badge-creator"},"_npmUser":{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"},"repository":{"url":"git+https://github.com/amandaghassaei/flat-svg.git","type":"git"},"_npmVersion":"11.5.1","description":"A TypeScript library for converting nested SVGs into a flat list of elements, paths, or segments and applying style-based filters.","directories":{},"_nodeVersion":"24.5.0","dependencies":{"colord":"^2.9.3","svgpath":"^2.6.0","svg-parser":"^2.0.4","@adobe/css-tools":"^4.3.0-rc.1","@amandaghassaei/type-checks":"^1.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","tsx":"^4.19.3","chai":"^4.3.6","mocha":"^11.0.0","tslib":"^2.8.1","rollup":"^4.0.0","typedoc":"^0.28.0","typescript":"^5.7.0","@types/chai":"^4.3.4","@types/node":"^22.0.0","http-server":"^14.1.1","@types/mocha":"^10.0.1","@types/svg-parser":"^2.0.3","rollup-plugin-dts":"^6.1.0","rollup-plugin-delete":"^3.0.0","@rollup/plugin-terser":"^1.0.0","coverage-badge-creator":"^1.0.17","@rollup/plugin-commonjs":"^28.0.0","typedoc-plugin-markdown":"^4.0.0","@rollup/plugin-typescript":"^12.1.0","@rollup/plugin-node-resolve":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/flat-svg_2.0.0_1777914821120_0.2562206689932389","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@amandaghassaei/flat-svg","version":"2.0.1","keywords":["svg","flat","flatten","flattener","ungroup","path","shape","transform","style","parse","element","split","segment","filter"],"author":{"name":"Amanda Ghassaei"},"license":"MIT","_id":"@amandaghassaei/flat-svg@2.0.1","maintainers":[{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"}],"homepage":"https://apps.amandaghassaei.com/flat-svg/demo/","bugs":{"url":"https://github.com/amandaghassaei/flat-svg/issues"},"dist":{"shasum":"45e3fa8e3d074d53ef319a670550ed321a196aa9","tarball":"https://registry.npmjs.org/@amandaghassaei/flat-svg/-/flat-svg-2.0.1.tgz","fileCount":45,"integrity":"sha512-blQb0Fml8mCrT2KlrDs8nrEwTpT7ShWedX3bIeAK6xvbx54DMnEuwlC05U6kBmd1IRmIqq2MMiEHIojChZj67A==","signatures":[{"sig":"MEYCIQCiaIC4Aaa+yjLEYikVwMWlqMj8N/SaJB0rHqJwnt3arQIhAJLtC5m/otN9fqWi/NXrg8k5T+ikGsga2rW+HmwVenxa","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":395866},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"d3f3cd129bde060893ffb8d8d75b6fc919f6fcd7","scripts":{"docs":"typedoc --options ./typedoc.json","test":"mocha 'test/**/*.test.ts'","build":"rollup --config && tsc -p tsconfig.build.json && npm run docs && npm run make-coverage-badge","serve":"http-server -p 8080 -c-1","test-with-coverage":"c8 mocha 'test/**/*.test.ts'","make-coverage-badge":"c8 --reporter=json-summary mocha 'test/**/*.test.ts' && coverage-badge-creator"},"_npmUser":{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"},"repository":{"url":"git+https://github.com/amandaghassaei/flat-svg.git","type":"git"},"_npmVersion":"11.5.1","description":"A TypeScript library for converting nested SVGs into a flat list of elements, paths, or segments and applying style-based filters.","directories":{},"_nodeVersion":"24.5.0","dependencies":{"colord":"^2.9.3","svgpath":"^2.6.0","svg-parser":"^2.0.4","@adobe/css-tools":"^4.3.0-rc.1","@amandaghassaei/type-checks":"^1.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","tsx":"^4.19.3","chai":"^4.3.6","mocha":"^11.0.0","tslib":"^2.8.1","rollup":"^4.0.0","typedoc":"^0.28.0","typescript":"^5.7.0","@types/chai":"^4.3.4","@types/node":"^22.0.0","http-server":"^14.1.1","@types/mocha":"^10.0.1","@types/svg-parser":"^2.0.3","rollup-plugin-dts":"^6.1.0","rollup-plugin-delete":"^3.0.0","@rollup/plugin-terser":"^1.0.0","coverage-badge-creator":"^1.0.17","@rollup/plugin-commonjs":"^28.0.0","typedoc-plugin-markdown":"^4.0.0","@rollup/plugin-typescript":"^12.1.0","@rollup/plugin-node-resolve":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/flat-svg_2.0.1_1778770342517_0.48480929934326467","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@amandaghassaei/flat-svg","version":"2.0.2","keywords":["svg","flat","flatten","flattener","ungroup","path","shape","transform","style","parse","element","split","segment","filter"],"author":{"name":"Amanda Ghassaei"},"license":"MIT","_id":"@amandaghassaei/flat-svg@2.0.2","maintainers":[{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"}],"homepage":"https://apps.amandaghassaei.com/flat-svg/demo/","bugs":{"url":"https://github.com/amandaghassaei/flat-svg/issues"},"dist":{"shasum":"84118cf64f7c4eaf197060c7711985c4576303c4","tarball":"https://registry.npmjs.org/@amandaghassaei/flat-svg/-/flat-svg-2.0.2.tgz","fileCount":45,"integrity":"sha512-PiNXu7QeKc935NxJIDSDlHJ7hMpf0z8vxB17gKww8wpP5YeQ/pc9xYG7pUcKvDU5DWjHruaxySCeAsm1TovSxg==","signatures":[{"sig":"MEUCIQCGpfDu+3jz0z/VKMQ3K3H5qHUIljjZaJUWYqh0cxQPEgIgRZhruPKMLo1KjDu2D+vdTB7zUWeubRkyGaBzC98b66A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":397899},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"fe166de8218adb9311d8501348b63e0b9a617302","scripts":{"docs":"typedoc --options ./typedoc.json","test":"mocha 'test/**/*.test.ts'","build":"rollup --config && tsc -p tsconfig.build.json && npm run docs && npm run make-coverage-badge","serve":"http-server -p 8080 -c-1","test-with-coverage":"c8 mocha 'test/**/*.test.ts'","make-coverage-badge":"c8 --reporter=json-summary mocha 'test/**/*.test.ts' && coverage-badge-creator"},"_npmUser":{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"},"repository":{"url":"git+https://github.com/amandaghassaei/flat-svg.git","type":"git"},"_npmVersion":"11.5.1","description":"A TypeScript library for converting nested SVGs into a flat list of elements, paths, or segments and applying style-based filters.","directories":{},"_nodeVersion":"24.5.0","dependencies":{"colord":"^2.9.3","svgpath":"^2.6.0","svg-parser":"^2.0.4","@adobe/css-tools":"^4.3.0-rc.1","@amandaghassaei/type-checks":"^1.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","tsx":"^4.19.3","chai":"^4.3.6","mocha":"^11.0.0","tslib":"^2.8.1","rollup":"^4.0.0","typedoc":"^0.28.0","typescript":"^5.7.0","@types/chai":"^4.3.4","@types/node":"^22.0.0","http-server":"^14.1.1","@types/mocha":"^10.0.1","@types/svg-parser":"^2.0.3","rollup-plugin-dts":"^6.1.0","rollup-plugin-delete":"^3.0.0","@rollup/plugin-terser":"^1.0.0","coverage-badge-creator":"^1.0.17","@rollup/plugin-commonjs":"^28.0.0","typedoc-plugin-markdown":"^4.0.0","@rollup/plugin-typescript":"^12.1.0","@rollup/plugin-node-resolve":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/flat-svg_2.0.2_1778770616456_0.6559193408221098","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"@amandaghassaei/flat-svg","version":"2.0.3","keywords":["svg","flat","flatten","flattener","ungroup","path","shape","transform","style","parse","element","split","segment","filter"],"author":{"name":"Amanda Ghassaei"},"license":"MIT","_id":"@amandaghassaei/flat-svg@2.0.3","maintainers":[{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"}],"homepage":"https://apps.amandaghassaei.com/flat-svg/demo/","bugs":{"url":"https://github.com/amandaghassaei/flat-svg/issues"},"dist":{"shasum":"e41146d39ab243d326e47330921e4422625c5d5b","tarball":"https://registry.npmjs.org/@amandaghassaei/flat-svg/-/flat-svg-2.0.3.tgz","fileCount":45,"integrity":"sha512-VH8BL6R9VfwAZBP9hqe6NWKuQ87a9ziNc4Ec+p2n4bzKsbXbmZRdoF+m4SIVbQfHvszgZpQQQzkPdWer6txkKQ==","signatures":[{"sig":"MEYCIQCHey1h/iyc7YIUf7K7d7rzgWw25QFJIl9olWjIncL+/gIhAPdSdB6mDge2dkRPPDHdoW8tOPJehbxn8UZ1tMEk4+1C","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":397227},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"fc8ccb94637fec19d121a3026035d79c7ec75413","scripts":{"docs":"typedoc --options ./typedoc.json","test":"mocha 'test/**/*.test.ts'","build":"rollup --config && tsc -p tsconfig.build.json && npm run docs && npm run make-coverage-badge","serve":"http-server -p 8080 -c-1","test-with-coverage":"c8 mocha 'test/**/*.test.ts'","make-coverage-badge":"c8 --reporter=json-summary mocha 'test/**/*.test.ts' && coverage-badge-creator"},"_npmUser":{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"},"repository":{"url":"git+https://github.com/amandaghassaei/flat-svg.git","type":"git"},"_npmVersion":"11.5.1","description":"A TypeScript library for converting nested SVGs into a flat list of elements, paths, or segments and applying style-based filters.","directories":{},"_nodeVersion":"24.5.0","dependencies":{"colord":"^2.9.3","svgpath":"^2.6.0","svg-parser":"^2.0.4","@adobe/css-tools":"^4.4.4","@amandaghassaei/type-checks":"^1.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","tsx":"^4.19.3","chai":"^4.3.6","mocha":"^11.0.0","tslib":"^2.8.1","rollup":"^4.0.0","typedoc":"^0.28.0","typescript":"^5.7.0","@types/chai":"^4.3.4","@types/node":"^22.0.0","http-server":"^14.1.1","@types/mocha":"^10.0.1","@types/svg-parser":"^2.0.3","rollup-plugin-dts":"^6.1.0","rollup-plugin-delete":"^3.0.0","@rollup/plugin-terser":"^1.0.0","coverage-badge-creator":"^1.0.17","@rollup/plugin-commonjs":"^28.0.0","typedoc-plugin-markdown":"^4.0.0","@rollup/plugin-typescript":"^12.1.0","@rollup/plugin-node-resolve":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/flat-svg_2.0.3_1779286026728_0.01645534373030899","host":"s3://npm-registry-packages-npm-production"}},"2.0.4":{"name":"@amandaghassaei/flat-svg","version":"2.0.4","keywords":["svg","flat","flatten","flattener","ungroup","path","shape","transform","style","parse","element","split","segment","filter"],"author":{"name":"Amanda Ghassaei"},"license":"MIT","_id":"@amandaghassaei/flat-svg@2.0.4","maintainers":[{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"}],"homepage":"https://apps.amandaghassaei.com/flat-svg/demo/","bugs":{"url":"https://github.com/amandaghassaei/flat-svg/issues"},"dist":{"shasum":"3081e902ea945999896de8d4e136e2368097af0d","tarball":"https://registry.npmjs.org/@amandaghassaei/flat-svg/-/flat-svg-2.0.4.tgz","fileCount":45,"integrity":"sha512-K1MAiJxIePihY7MXUqzj5/TVCCO1RbjjGQvHMDZ0+h4ENx1rmupW9BQais2B7+MzoyyW0dt0XH2vADJ0an1aYg==","signatures":[{"sig":"MEQCIFHKUqG6z3hb4vzyS+DeTa2CVCWtC1zfZu1QUFqLc9JqAiAEdDxbATu2xgBRgPN3qfCd0pHT2kHkBpCdhnoAe87Jrg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":397227},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"7b18aabebe747b1aef5706ef0c0cda6d58deca0b","scripts":{"docs":"typedoc --options ./typedoc.json","test":"mocha 'test/**/*.test.ts'","build":"rollup --config && tsc -p tsconfig.build.json && npm run docs && npm run make-coverage-badge","serve":"http-server -p 8080 -c-1","test-with-coverage":"c8 mocha 'test/**/*.test.ts'","make-coverage-badge":"c8 --reporter=json-summary mocha 'test/**/*.test.ts' && coverage-badge-creator"},"_npmUser":{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"},"repository":{"url":"git+https://github.com/amandaghassaei/flat-svg.git","type":"git"},"_npmVersion":"11.5.1","description":"A TypeScript library for converting nested SVGs into a flat list of elements, paths, or segments and applying style-based filters.","directories":{},"_nodeVersion":"24.5.0","dependencies":{"colord":"^2.9.3","svgpath":"^2.6.0","svg-parser":"^2.0.4","@adobe/css-tools":"^4.4.4","@types/svg-parser":"^2.0.3","@amandaghassaei/type-checks":"^1.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","tsx":"^4.19.3","chai":"^4.3.6","mocha":"^11.0.0","tslib":"^2.8.1","rollup":"^4.0.0","typedoc":"^0.28.0","typescript":"^5.7.0","@types/chai":"^4.3.4","@types/node":"^22.0.0","http-server":"^14.1.1","@types/mocha":"^10.0.1","rollup-plugin-dts":"^6.1.0","rollup-plugin-delete":"^3.0.0","@rollup/plugin-terser":"^1.0.0","coverage-badge-creator":"^1.0.17","@rollup/plugin-commonjs":"^28.0.0","typedoc-plugin-markdown":"^4.0.0","@rollup/plugin-typescript":"^12.1.0","@rollup/plugin-node-resolve":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/flat-svg_2.0.4_1779286728464_0.5183877272910884","host":"s3://npm-registry-packages-npm-production"}},"2.0.5":{"name":"@amandaghassaei/flat-svg","version":"2.0.5","description":"A TypeScript library for converting nested SVGs into a flat list of elements, paths, or segments and applying style-based filters.","main":"dist/index.js","types":"dist/index.d.ts","type":"module","keywords":["svg","flat","flatten","flattener","ungroup","path","shape","transform","style","parse","element","split","segment","filter"],"scripts":{"build":"rollup --config && tsc -p tsconfig.build.json && npm run docs && npm run make-coverage-badge","test":"mocha 'test/**/*.test.ts'","test-with-coverage":"c8 mocha 'test/**/*.test.ts'","make-coverage-badge":"c8 --reporter=json-summary mocha 'test/**/*.test.ts' && coverage-badge-creator","docs":"typedoc --options ./typedoc.json","serve":"http-server -p 8080 -c-1"},"repository":{"type":"git","url":"git+https://github.com/amandaghassaei/flat-svg.git"},"author":{"name":"Amanda Ghassaei"},"license":"MIT","bugs":{"url":"https://github.com/amandaghassaei/flat-svg/issues"},"homepage":"https://apps.amandaghassaei.com/flat-svg/demo/","publishConfig":{"access":"public"},"dependencies":{"@adobe/css-tools":"^4.4.4","@amandaghassaei/type-checks":"^1.1.1","@types/svg-parser":"^2.0.3","colord":"^2.9.3","svg-parser":"^2.0.4","svgpath":"^2.6.0"},"devDependencies":{"@rollup/plugin-commonjs":"^28.0.0","@rollup/plugin-node-resolve":"^16.0.0","@rollup/plugin-terser":"^1.0.0","@rollup/plugin-typescript":"^12.1.0","@types/chai":"^4.3.4","@types/mocha":"^10.0.1","@types/node":"^22.0.0","c8":"^10.0.0","chai":"^4.3.6","coverage-badge-creator":"^1.0.17","http-server":"^14.1.1","mocha":"^11.0.0","rollup":"^4.0.0","rollup-plugin-delete":"^3.0.0","rollup-plugin-dts":"^6.1.0","tslib":"^2.8.1","tsx":"^4.19.3","typedoc":"^0.28.0","typedoc-plugin-markdown":"^4.0.0","typescript":"^5.7.0"},"_id":"@amandaghassaei/flat-svg@2.0.5","gitHead":"901d5702a1f95ad3f1fdce84ab898a9de5cb7f5f","_nodeVersion":"24.5.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-1oj2jW4P3reK3rQ+ohxvUXB9YZqgOAk3hPULZJzFoKc/CimEBGecAzQuz+xerfh5aXSZAqNwFEBxZoJUkcPDXw==","shasum":"b2c068251d240f9923c519c99c63af5edce370ff","tarball":"https://registry.npmjs.org/@amandaghassaei/flat-svg/-/flat-svg-2.0.5.tgz","fileCount":45,"unpackedSize":398725,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCsusr5KSLzlBckyi0wWQaGx2t+rgG9bgKiQJyWKcwgfgIhAIGFijrS80ZiyFRvsaFAajjnB8cBK7Ox+43iN8ejvNcB"}]},"_npmUser":{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"},"directories":{},"maintainers":[{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/flat-svg_2.0.5_1779642268138_0.12171656768686523"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-26T19:19:23.763Z","modified":"2026-05-24T17:04:28.411Z","1.0.0":"2025-02-26T19:19:24.133Z","1.0.1":"2025-02-26T19:20:08.679Z","1.0.2":"2025-02-26T19:29:15.591Z","1.0.3":"2025-04-23T23:17:03.051Z","2.0.0":"2026-05-04T17:13:41.280Z","2.0.1":"2026-05-14T14:52:22.708Z","2.0.2":"2026-05-14T14:56:56.668Z","2.0.3":"2026-05-20T14:07:06.876Z","2.0.4":"2026-05-20T14:18:48.612Z","2.0.5":"2026-05-24T17:04:28.300Z"},"bugs":{"url":"https://github.com/amandaghassaei/flat-svg/issues"},"author":{"name":"Amanda Ghassaei"},"license":"MIT","homepage":"https://apps.amandaghassaei.com/flat-svg/demo/","keywords":["svg","flat","flatten","flattener","ungroup","path","shape","transform","style","parse","element","split","segment","filter"],"repository":{"type":"git","url":"git+https://github.com/amandaghassaei/flat-svg.git"},"description":"A TypeScript library for converting nested SVGs into a flat list of elements, paths, or segments and applying style-based filters.","maintainers":[{"name":"amandaghassaei","email":"amandaghassaei@gmail.com"}],"readme":"# @amandaghassaei/flat-svg\n\n[![NPM Package](https://img.shields.io/npm/v/@amandaghassaei/flat-svg)](https://www.npmjs.com/package/@amandaghassaei/flat-svg)\n[![Build Size](https://img.shields.io/bundlephobia/min/@amandaghassaei/flat-svg)](https://bundlephobia.com/result?p=@amandaghassaei/flat-svg)\n[![NPM Downloads](https://img.shields.io/npm/dw/@amandaghassaei/flat-svg)](https://www.npmtrends.com/@amandaghassaei/flat-svg)\n[![License](https://img.shields.io/npm/l/@amandaghassaei/flat-svg)](https://github.com/amandaghassaei/flat-svg/blob/main/LICENSE)\n![](https://img.shields.io/badge/Coverage-100%25-83A603.svg?prefix=$coverage$)\n\nA TypeScript library for converting nested SVGs into a flat list of elements, paths, or segments with style information preserved. Also contains helper functions for filtering flattened SVGs by style (e.g. stroke, fill, opacity, dash-array, etc).\n\nTry it out: [apps.amandaghassaei.com/flat-svg/demo/](https://apps.amandaghassaei.com/flat-svg/demo/)\n\nKey features:\n\n-   Flattens and removes groups and applies transforms\n-   Applies any id/class-based SVG styles onto child components; preserves each element's own id/class and surfaces the ancestor (`<g>`) chain as `ancestorIds` / `ancestorClasses`\n-   Exposes flattened SVG geometry in several formats: as original SVG element type (e.g. circle, rect, polyline, path, etc), geometry converted to SVG paths, or geometry split into segments. Segments are essentially split paths and may be lines, quadratic/cubic beziers, or arcs (if preserveArcs flag is true)\n-   Exposes helper functions for filtering by element style (e.g. stroke color, dash-array, opacity), with both object-returning and index-returning variants for use in multi-step filter pipelines\n-   Exposes diagnostic getters for surfacing problematic content in an imported SVG — zero-length segments, isolated points from degenerate shapes, and a `clip-path` flag — plus an `analyze()` method that bundles everything into one JSON-serializable overview\n-   Converts all `<path>` coordinates to absolute coordinates\n-   Extracts top-level `<defs>` and `<style>` tags during flattening\n-   Option to preserve arcs when exporting as paths/segments, as arcs cannot be exactly represented via cubic beziers\n-   Written in Typescript with exported type declarations\n-   Includes unit tests with 100% coverage\n<!-- - Option to flip y-axis (move origin to bottom left). -->\n\nIf you are having trouble with an SVG file, try debugging in the [demo page](https://apps.amandaghassaei.com/flat-svg/demo/). When submitting an issue, please attach an example SVG that is not working so I can add it to the suite of test cases. This library has been extensively tested with SVGs from Adobe Illustrator.\n\nContents:\n\n-   [Installation](#installation)\n-   [Use](#use)\n-   [Limitations](#limitations)\n-   [License](#license)\n-   [Development](#development)\n\n## Installation\n\n### Install via npm\n\n```sh\nnpm install @amandaghassaei/flat-svg\n```\n\nThen import via:\n\n```js\nimport { FlatSVG } from '@amandaghassaei/flat-svg';\n```\n\n### Import into HTML\n\n_OR_ in the browser you can add [bundle/flat-svg.js](https://github.com/amandaghassaei/flat-svg/blob/main/bundle/flat-svg.js) or [bundle/flat-svg.min.js](https://github.com/amandaghassaei/flat-svg/blob/main/bundle/flat-svg.min.js) to your html:\n\n```html\n<html>\n    <head>\n        ....\n        <script src=\"flat-svg.min.js\"></script>\n    </head>\n    <body></body>\n</html>\n```\n\nThen in your js files, you can access the global variable `FlatSVGLib`:\n\n```js\nconst { FlatSVG } = FlatSVGLib;\n```\n\n## Use\n\nComplete API in the [docs](https://github.com/amandaghassaei/flat-svg/tree/main/docs).\n\n```js\nimport { FlatSVG } from '@amandaghassaei/flat-svg';\n\n// Init with svgString and options.\n// options.preserveArcs defaults to false.\nconst flatSVG = new FlatSVG(svgString, { preserveArcs: true });\n// Get a flat list of elements, paths, or segments from your svgString:\n// flatSVG.elements returns a flattened list of SVG geometry\n//      (e.g. circle, rect, polyline, path, etc).\n//      Elements have structure: {\n//        tagName, properties,\n//        transform?,                              // composed ancestor matrix\n//        clipPaths?, masks?, filters?,            // ancestor chains (see Diagnostics)\n//        ancestorIds?, ancestorClasses?,          // ancestor (<g>) id/class chain (see Element lineage)\n//      }\n// flatSVG.paths returns a flattened list of SVG paths w abs coordinates\n//      (converts other SVG element types to path)\n//      Paths have structure: { properties, sourceElementIndex }\n// flatSVG.segments returns a flattened list of segments w abs coordinates\n//      Segments may be lines, quadratic/cubic beziers, or arcs. Discriminate\n//      by the `type` field (FLAT_SEGMENT_LINE / FLAT_SEGMENT_BEZIER /\n//      FLAT_SEGMENT_ARC, exported as constants).\n//      Line segments have structure:\n//        { type, p1, p2, properties, sourceElementIndex }\n//      Bezier segments have structure:\n//        { type, p1, p2, controlPoints, properties, sourceElementIndex }\n//      If preserveArcs flag is true, arc segments have structure:\n//        { type, p1, p2, rx, ry, xAxisRotation, largeArcFlag, sweepFlag,\n//          properties, sourceElementIndex }\n//      sourceElementIndex on a path or segment is its index back into\n//      flatSVG.elements (resolves to the FlatElement that produced it).\nconst { elements, paths, segments } = flatSVG;\n\n// Check if FlatSVG encountered any warnings during parsing.\n// `warnings` is fully populated by the time the constructor returns —\n// the constructor eagerly walks elements/paths/segments so this list\n// reflects the complete parse-time set, not just whatever getters you've\n// touched.\nconst { warnings } = flatSVG;\n\n// Query other svg properties.\nconst { units, viewBox, defs } = flatSVG;\n\n// You can also get elements, paths, and segments as an SVG string:\nconst { elementsAsSVG, pathsAsSVG, segmentsAsSVG } = flatSVG;\n```\n\n### Coordinate spaces — `elements` vs `paths` / `segments`\n\n`elements[].properties` is in **source coordinates**; `paths[].properties.d` and `segments[].p1`/`p2` are in **viewBox coordinates**. flat-svg composes ancestor transforms onto each element's `transform` field but leaves `properties` (x/y/cx/cy/points/...) untouched — these are the values the source SVG author wrote. Drawing from `properties` directly will place geometry at the wrong location whenever any ancestor has a `transform` attribute. To get rendered geometry, use `paths` or `segments`, which apply the transform during conversion.\n\n```js\n// Source: <svg><g transform=\"translate(50,50)\"><circle cx=\"10\" cy=\"10\" r=\"5\"/></g></svg>\nflatSVG.elements[0].properties.cx;        // 10  (source — what the author wrote)\nflatSVG.elements[0].transform;            // { a:1, b:0, c:0, d:1, e:50, f:50 }\nflatSVG.paths[0].properties.d;            // \"M65,60 A5,5 0 1,0 55,60 ...\" (rendered)\nflatSVG.segments[0].p1;                   // [..., ...] in viewBox coordinates\n```\n\nIf you only need the `viewBox` or `units` of an SVG (e.g. to size a thumbnail\nor preview without parsing the full geometry), use the lightweight static\nhelpers — they skip the element / path / segment walk entirely:\n\n```js\nimport { FlatSVG } from '@amandaghassaei/flat-svg';\n\n// Returns [min-x, min-y, width, height]; falls back to root x/y/width/height\n// if no viewBox attribute is present.\nconst viewBox = FlatSVG.viewBox(svgString);\n\n// Returns one of 'in' | 'cm' | 'mm' | 'px' | 'pt' | 'em' | 'ex' | 'pc'.\nconst units = FlatSVG.units(svgString);\n```\n\nIn addition, flat-svg exposes some helper functions for filtering elements by style:\n\n```js\nconst redElements = flatSVG.filterElementsByStyle({\n    key: 'stroke',\n    value: 'red',\n    // Optionally add a tolerance, defaults to 0.\n    // For colors, tolerance is based on the the perceived color difference\n    // for two colors according to Delta E2000 in the [0, 1] range\n    // https://en.wikipedia.org/wiki/Color_difference#CIEDE2000\n    tolerance: 0.1,\n});\n\n// Acceptable formats for color values:\n// \"#FFF\"\n// \"#ffffff\"\n// \"#ffffffff\"\n// \"rgb(255, 255, 255)\"\n// \"rgba(255, 255, 255, 0.5)\"\n// \"rgba(100% 100% 100% / 50%)\"\n// \"hsl(90, 100%, 100%)\"\n// \"hsla(90, 100%, 100%, 0.5)\"\n// \"hsla(90deg 100% 100% / 50%)\"\n// \"tomato\"\n\n// Pass in an array of filters to get items that pass all filters.\nconst bluePathsFilled = flatSVG.filterPathsByStyle([\n    {\n        key: 'fill',\n        value: '#00f',\n    },\n    {\n        key: 'stroke-width',\n        value: 0,\n        tolerance: 0.001,\n    },\n]);\n\n// Optionally pass in an array of booleans to indicate elements\n// to exclude from filter.\n// \"excluded\" array should have same length as items you are filtering.\n// This is useful when you want to apply more complex boolean logic to your filters.\nconst transparentSegmentsWithExclusions = flatSVG.filterSegmentsByStyle(\n    {\n        key: 'opacity',\n        value: 0.5,\n        tolerance: 0.25,\n    },\n    [false, false, false, false, false, true, false, false, false]\n);\n```\n\nIn the case that your SVG contains both an [opacity](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/opacity) and [stroke](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke) in the form `rgba()`, stroke alpha is mixed with opacity to get the true opacity of an object. In general this library expects that most information about an object's styling is stored in its stroke properties, as the main use case for this library is parsing designs comprised of many lines (as opposed to filled shapes), such as origami crease patterns and vector files for laser cutting or pen plotting.\n\n### Filtering by index\n\n`filterElementsByStyle` / `filterPathsByStyle` / `filterSegmentsByStyle` each have an index-returning companion that returns `number[]` — the indices of matches into `.elements` / `.paths` / `.segments`. These are useful when threading a shared `excluded[]` tracker through multiple filter steps (e.g. a wizard-style import that narrows the remaining pool on each step), since indices can be used directly without re-reconciling objects against the source array.\n\n```js\n// Wizard-style multi-step filtering: each step claims segments from the pool;\n// excluded[] tracks what's been claimed so a final catch-all can scoop the rest.\nconst excluded = new Array(flatSVG.segments.length).fill(false);\n\nconst redIndices = flatSVG.filterSegmentIndicesByStyle(\n    { key: 'stroke', value: 'red', tolerance: 0.1 },\n    excluded,\n);\nfor (const i of redIndices) excluded[i] = true;\n\nconst blueIndices = flatSVG.filterSegmentIndicesByStyle(\n    { key: 'stroke', value: 'blue', tolerance: 0.1 },\n    excluded,\n);\nfor (const i of blueIndices) excluded[i] = true;\n\n// Whatever's left — segments we didn't match by stroke color.\nconst unmatchedSegments = flatSVG.segments.filter((_, i) => !excluded[i]);\n```\n\nThe index-returning methods have the same signature as their object-returning counterparts and share the internal computed-properties cache.\n\n### Element lineage\n\nflat-svg flattens away ancestor containers (`<g>`) but preserves their `id`/`class` lineage on each leaf element, so consumers can reason about ancestor structure after flattening:\n\n-   **Own values:** The element's own `id` / `class` attributes stay on `properties.id` / `properties.class` and round-trip cleanly through `*AsSVG`.\n-   **Ancestor chain:** The `id` / `class` of ancestor containers (excluding the element itself) is surfaced as top-level fields on the FlatElement: `ancestorIds` and `ancestorClasses`. Both are space-joined strings, ordered outermost first. They are NOT serialized into `*AsSVG` output — these aren't real SVG attributes, they're flat-svg-internal lineage metadata that don't round-trip.\n\n```js\n// <g id=\"layer1\" class=\"cuts\">\n//   <g id=\"thick\" class=\"primary\">\n//     <line id=\"seg1\" class=\"bold\" .../>\n//   </g>\n// </g>\nconst el = flatSVG.elements[0];\nel.properties.id;       // \"seg1\"\nel.properties.class;    // \"bold\"\nel.ancestorIds;         // \"layer1 thick\"\nel.ancestorClasses;     // \"cuts primary\"\n```\n\nPaths and segments don't carry the lineage chain themselves. To look it up, resolve via `sourceElementIndex` back to the source FlatElement:\n\n```js\nconst path = flatSVG.paths[0];\nflatSVG.elements[path.sourceElementIndex].ancestorIds;\n```\n\n### Diagnostics\n\n`FlatSVG` exposes several getters that surface potentially-problematic content in an imported SVG — a `clip-path` flag, zero-length segments, isolated points from degenerate shapes, and elements whose tagName flat-svg can't convert to paths/segments. All results are subsets of `.elements` / `.segments` or cheap boolean / array checks, and are JSON-serializable.\n\n```js\n// True if any element has a clip-path applied (self or inherited).\n// flat-svg does NOT perform geometric clipping — this flag lets consumers warn\n// their users that the imported SVG uses clip-paths that won't be applied.\n// Clipped elements are still present in their entirety in elements/paths/segments.\n// (No equivalent flag for SVG <mask> — those are rare in this library's input\n// domain. Detect them yourself with flatSVG.elements.some(e => e.masks?.length).)\nconst hasClipPaths = flatSVG.containsClipPaths;  // boolean\n\n// Per SVG spec, clip-path / mask / filter do NOT inherit as CSS properties —\n// instead they compose as a chain, with each link applying to the rendering\n// of the result below it. flat-svg collects these chains on each FlatElement\n// (ordered outermost ancestor first, self last). The element's own\n// properties map does NOT contain these attributes — the chain is the\n// source of truth.\n//\n//   <g clip-path=\"url(#a)\">\n//     <g clip-path=\"url(#b)\">\n//       <rect clip-path=\"url(#c)\"/>\n//     </g>\n//   </g>\n//   → rect.clipPaths === ['url(#a)', 'url(#b)', 'url(#c)']\n//\n// Each entry is the raw attribute value; consumers can parse url(#id) themselves.\nconst chainsByElement = flatSVG.elements.map((e) => ({\n    clipPaths: e.clipPaths,  // ReadonlyArray<string> | undefined\n    masks:     e.masks,      // ReadonlyArray<string> | undefined\n    filters:   e.filters,    // ReadonlyArray<string> | undefined\n}));\n\n// Truly zero-length segments — segments that collapse to a single point:\n//   - Line: p1 === p2\n//   - Quadratic/cubic bezier: p1 === p2 AND all control points === p1\n//     (a bezier where p1 === p2 but control points are elsewhere traces a loop\n//     and has nonzero arc length; it is NOT flagged here)\n//   - Arc: p1 === p2 AND rx === 0 AND ry === 0\n//     (a full-loop arc with p1 === p2 and nonzero radii is NOT flagged)\n// Sources include <line> with identical endpoints, degenerate paths, and\n// zero-size shapes like <circle r=\"0\"> / <ellipse rx=\"0\"> / <rect width=\"0\" height=\"0\">\n// whose path representations decompose to zero-length segments.\n// Returns indices into flatSVG.segments — use the same `excluded[]` pattern as\n// filterSegmentIndicesByStyle to drop them from a filter pipeline.\nconst zeroIndices = flatSVG.zeroLengthSegmentIndices;\n\n// Isolated points from SVG elements that describe a single point with no\n// connecting segments:\n//   - <polyline> or <polygon> with only one point,\n//   - <path> subpaths that are only moveto commands — e.g. \"M x y\", \"M x y Z\",\n//     or any dangling M not followed by a draw command, as in \"M 1 1 M 2 2 L 3 3\"\n//     (first M is dangling; one entry per dangling M).\n// Zero-size rects / zero-radius circles and ellipses are NOT stray vertices —\n// they flow through the normal pipeline and surface as zero-length segments in\n// flatSVG.zeroLengthSegmentIndices.\n// Each entry has { position: [x, y], cause, sourceElementIndex } where position\n// is in viewBox coordinates (transforms applied), cause is one of the\n// FLAT_SVG_STRAY_VERTEX_* constants, and sourceElementIndex points back into\n// flatSVG.elements at the element that produced this stray vertex.\nconst strays = flatSVG.strayVertices;\n\n// Elements whose tagName flat-svg can't convert to paths/segments — e.g.\n// <use>, <text>, <image>, <foreignObject>, nested <svg>, <style>/<defs> that\n// aren't direct children of the <svg> root (top-level <style>/<defs> are\n// parsed normally), or unknown tags. These are routed here at flatten time\n// and do NOT appear in elements / paths / segments / *AsSVG. Position info\n// (transform, properties) is preserved so consumers can warn users about\n// content that was filtered out, list affected tagNames, render placeholders, etc.\n// Non-rendering metadata tags (<title>, <desc>, <metadata>) are silently\n// skipped and do NOT appear here — they have no visual content to surface.\nconst unsupported = flatSVG.unsupportedElements;\nconst unsupportedTagNames = [...new Set(unsupported.map((e) => e.tagName))];\n```\n\nStray-vertex `cause` values are exported as constants and as a union type:\n\n```js\nimport {\n    FLAT_SVG_STRAY_VERTEX_MOVETO_ONLY,\n    FLAT_SVG_STRAY_VERTEX_POLYLINE_SINGLE_POINT,\n    FLAT_SVG_STRAY_VERTEX_POLYGON_SINGLE_POINT,\n    type FlatSVGStrayVertexCause,\n} from '@amandaghassaei/flat-svg';\n\nfor (const stray of flatSVG.strayVertices) {\n    if (stray.cause === FLAT_SVG_STRAY_VERTEX_MOVETO_ONLY) { /* ... */ }\n    const sourceElement = flatSVG.elements[stray.sourceElementIndex];\n}\n```\n\n`analyze()` bundles everything above into one JSON-serializable object, useful for building a single diagnostic overview of an imported SVG:\n\n```js\nconst analysis = flatSVG.analyze();\n// {\n//   viewBox, units,\n//   counts: { elements, paths, segments,\n//             zeroLengthSegments, strayVertices, defs,\n//             unsupportedElements },\n//   strokeColors: { none: number, colors: { [hex]: count } },\n//   fillColors:   { none: number, colors: { [hex]: count } },\n//   containsClipPaths: boolean,\n//   zeroLengthSegmentIndices, strayVertices, unsupportedElements,\n//   warnings,\n// }\nJSON.stringify(analysis);  // safe — no class instances\n```\n\nAll output is typed `readonly` — TypeScript prevents mutation at compile time. In addition, sibling elements that share an ancestor may share `transform` / `clipPaths` / `masks` / `filters` / `properties` references in memory (the inheritance chain is collapsed onto leaves without per-leaf copies). If you need a mutable working copy, spread it yourself: `[...arr]` for arrays, `{ ...obj }` for objects.\n\n### Finding elements by absence of paint\n\nTo find elements with no authored `stroke` or `fill` — explicit `\"none\"` or missing attribute — pass `value: 'none'` to any of the filter methods:\n\n```js\n// Elements where stroke is \"none\" OR no stroke attribute (self or inherited).\nconst noStroke = flatSVG.filterElementsByStyle({ key: 'stroke', value: 'none' });\n\n// Elements where fill is \"none\" OR no fill attribute (self or inherited).\nconst noFill = flatSVG.filterElementsByStyle({ key: 'fill', value: 'none' });\n\n// Elements with NEITHER stroke nor fill — filter arrays AND together.\nconst noPaint = flatSVG.filterElementsByStyle([\n    { key: 'stroke', value: 'none' },\n    { key: 'fill', value: 'none' },\n]);\n\n// Fill-only elements (has fill, no stroke) — exclude fillless from a strokeless filter.\nconst excluded = new Array(flatSVG.elements.length).fill(false);\nfor (const i of flatSVG.filterElementIndicesByStyle({ key: 'fill', value: 'none' })) excluded[i] = true;\nconst fillOnly = flatSVG.filterElementsByStyle({ key: 'stroke', value: 'none' }, excluded);\n```\n\nThe `'none'` filter value is source-only: it matches elements whose resolved `stroke` or `fill` property is exactly the string `\"none\"` or missing. It does NOT treat `stroke=\"transparent\"`, `stroke=\"rgba(0,0,0,0)\"`, `stroke-opacity=\"0\"`, or `opacity=\"0\"` as strokeless — those are explicit color/opacity choices rather than absence of paint.\n\nThe same pattern works for `filterPathsByStyle` / `filterSegmentsByStyle` and their index-returning variants.\n\n## Limitations\n\nSome limitations of this library:\n\n-   flat-svg preserves `<clipPath>`, `<mask>`, and `<filter>` definitions but does NOT apply them during flattening — geometry is returned unclipped/unmasked (this would be cool to add, see [Development](#development)). The `flatSVG.containsClipPaths` flag lets consumers warn users that clip-paths won't be applied; the per-element `clipPaths` / `masks` / `filters` chains expose the underlying references for advanced inspection.\n-   Does not handle Adobe Illustrator's legacy Style Attribute (Entity References) SVG export option (DTD entities like `&st0;`). Rare in modern files — AI defaulted away from this option around 2012.\n-   **`<use>` references are not expanded.** A `<use href=\"#id\"/>` (and its subtree) lands in `flatSVG.unsupportedElements` rather than pulling the referenced geometry into `elements` / `paths` / `segments`. If your input depends on `<use>` expansion, preprocess upstream (e.g. svgo's `removeUseElems` plugin, or `inkscape --export-plain-svg` with clones flattened).\n-   **`currentColor` is resolved on `fill` and `stroke` only.** flat-svg substitutes case-insensitively against the inherited `color` property at parse time, defaulting to `\"black\"` when none is set. Not resolved: `stop-color` / `flood-color` / `lighting-color`, recursive `color=\"currentColor\"` (falls back to `\"black\"`), and other CSS indirections (`var(--foo)`, `inherit`, `color-mix()`).\n-   Does not support units on width/height properties SVG child elements, for example:\n\n```xml\n<rect x=\"100\" y=\"100\" width=\"50mm\" height=\"50mm\" />\n```\n\n-   **Importing flat-svg extends [colord](https://www.npmjs.com/package/colord) globally.** flat-svg uses colord internally for color parsing and Delta E2000 distance, and registers colord's `names` and `lab` plugins at module load via `colord.extend(...)`. colord's plugin registry is a single process-wide singleton with no per-instance / per-bundle scope, so any other code in the same bundle that imports colord will see these plugins applied as a side effect of importing flat-svg. Both plugins are additive (they enable new parses / methods, not override existing behavior), so the practical impact is that some color strings — `\"tomato\"`, `\"rebeccapurple\"`, etc. — that previously failed to parse start succeeding. If you need an unextended colord, isolate it in a separate bundle.\n\n### Divergences from the SVG spec\n\nThese behaviors are deliberate choices that don't match strict spec conformance. Each one exists to align the library's output with what real-world authoring tools (Illustrator, Inkscape, Figma, Sketch, Affinity) actually emit, or to keep the flattened representation useful to downstream consumers. If you need strict spec behavior, you'll need to post-process flat-svg's output or re-parse the SVG yourself.\n\n-   **Hidden elements (`display=\"none\"` or `visibility=\"hidden\"`) are kept in outputs, with the hidden state propagated to descendants.** flat-svg does not drop hidden elements during flattening — `elements`, `paths`, `segments`, and `*AsSVG` contain the complete flattened geometry regardless of render-tree visibility. To make consumer-side filtering practical, the library also treats `display` as an inherited property — diverging from the SVG spec, where `display` doesn't inherit (an ancestor's `display: none` removes its subtree from the render tree without setting any attribute on descendants). flat-svg instead copies `display=\"none\"` down so each descendant carries it on its own `properties`. `visibility` is inherited per spec, with child-wins resolution (a child's `visibility=\"visible\"` correctly overrides an ancestor's `visibility=\"hidden\"`). To skip invisible elements:\n\n    ```js\n    const visible = flatSVG.elements.filter((e) => {\n        const p = e.properties as any;\n        return p.display !== 'none' && p.visibility !== 'hidden';\n    });\n    ```\n\n    All current diagnostic APIs rely on this inherited-`display` behavior.\n\n-   **Filters and color histograms only match explicitly authored values.** Elements with no `fill` or `stroke` attribute rely on SVG spec defaults (`fill=\"black\"`, `stroke=\"none\"`) for rendering, but flat-svg does NOT synthesize those defaults when filtering or counting — a filter for `fill: \"black\"` will NOT match `<rect/>` even though a browser would render it as a black square. This is deliberate: the source-query APIs answer \"what colors did the author write?\". In practice all major authoring tools write explicit `fill`/`stroke` attributes on every element, so this distinction rarely surfaces. To opt into rendering-aware behavior you can preprocess `elements` and write explicit `fill=\"black\"` / `stroke=\"none\"` onto any element missing those attributes before filtering.\n\n-   **Zero-length `Z` close commands are dropped.** A `Z` (or `z`) closes the current subpath by drawing a line from the current point back to the most recent `M`. When the path is already at its start point, that close-line has zero length — flat-svg omits the resulting segment instead of emitting it. Every major SVG authoring tool exports closed paths as `... L startX,startY z` (an explicit line back to the start, followed by `z`), so emitting the redundant `z` segment would inflate segment counts and add non-diagnostic noise to `zeroLengthSegmentIndices` on essentially every real-world SVG.\n\n-   **`<style>` selector matching covers `#id` and `.class` only.** flat-svg parses the full content of `<style>` blocks (top-level or inside `<defs>`) but only applies rules whose selector is a single id or class — `#header { fill: red }` and `.outline { stroke: black }` work; element-name selectors (`rect { fill: red }`), attribute selectors (`[data-tag] { ... }`), descendant/child combinators (`g > rect`), pseudo-classes, and any compound selector are silently ignored. Real SVGs from authoring tools mostly use class selectors so this rarely surfaces; hand-written stylesheets and some design-system exports may need preprocessing (e.g. inline the styles onto the elements before passing to flat-svg).\n\n## License\n\nThis work is distributed under an [MIT license](https://github.com/amandaghassaei/flat-svg/blob/main/LICENSE). Please note the licenses of its dependencies as well:\n\n-   [svg-parser](https://www.npmjs.com/package/svg-parser) (MIT License)\n-   [svgpath](https://www.npmjs.com/package/svgpath) (MIT License)\n-   [colord](https://www.npmjs.com/package/colord) (MIT license)\n-   [@adobe/css-tools](https://www.npmjs.com/package/@adobe/css-tools) (MIT license)\n-   [@amandaghassaei/type-checks](https://github.com/amandaghassaei/type-checks) (MIT license)\n-   Additionally, some code was borrowed from [svg-flatten](https://www.npmjs.com/package/svg-flatten), which is distributed under an [ISC license](https://github.com/stadline/svg-flatten/blob/master/LICENSE).\n\nBig thanks to the contributors of these packages for making their code available!\n\n## Development\n\nTo build:\n\n```sh\nnpm install\nnpm run build\n```\n\nPull requests welcome! If you are having trouble with a file, try debugging in the [demo page](https://apps.amandaghassaei.com/flat-svg/demo/). When submitting an issue, please attach an example SVG that is not working so I can add it to the suite of test cases.\n\nSome useful things to add next:\n\n-   Apply clip-paths to SVG geometry (this will require calculating intersections between clip-path region and underlying geometry).\n\n### Testing\n\nTo run unit tests with mocha/chai:\n\n```sh\nnpm run test\n```\n\nor, optionally:\n\n```sh\nnpm run test-with-coverage\n```\n\n### Demo\n\nTo serve demo locally:\n\n```sh\nnpm run serve\n```\n\nThen open [localhost:8080/demo](http://localhost:8080/demo) in your browser.\n","readmeFilename":"README.md"}