{"_id":"path2d-polyfill@3.2.4","bugs":{"url":"https://github.com/nilzona/path2d-polyfill/issues"},"dist":{"shasum":"d5848c013494ef2d8f95a4f10e552baf3d6702f1","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-3.2.4.tgz","fileCount":4,"integrity":"sha512-G/vgpFQssjIdsrtoKLeGJdwYYgSenp3sg0CKLt/3QLprnrEI3Jl26Ik8OQCLIEDAfmEMMkGXaJCr5UV+8/tjDQ==","signatures":[{"sig":"MEUCIQCO25IC+LxodJEuzxwPZWzY/7y7OgsO/QqvyuTnr+s4KAIgTugze6m/f8yH6J5dtyhsOlvR3A9gSPfd/dlI1TwlSSE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCcgC4nq1J+Pd9BI/H2IS21Y+vbNu2+ysgwDzb7H6NfpgIhAPUBFjA1EhIyrmvQiPbbILbEkAfXJ3nai9qumlkOcSzE"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/path2d-polyfill@3.2.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":12751,"size":5142,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-3.2.4.tgz"},"name":"path2d-polyfill","type":"module","author":"nilzona","browser":"dist/path2d-polyfill.min.js","exports":{"browser":"./dist/path2d-polyfill.min.js"},"license":"MIT","scripts":{"dev":"vite","lint":"cd ../.. && pnpm exec eslint ./packages/path2d-polyfill","test":"vitest run","build":"vite build && cp dist/path2d-polyfill.min.js test/path2d-polyfill.min.js","preview":"vite preview","test:watch":"vitest","check-types":"tsc --noEmit","format:check":"cd ../.. && pnpm exec prettier --check 'packages/path2d-polyfill/**' --ignore-unknown","format:write":"cd ../.. && pnpm exec prettier --write 'packages/path2d-polyfill/**' --ignore-unknown","test:coverage":"vitest run --coverage"},"version":"3.2.4","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"aed92d29-76fe-4ead-831e-790c6729fa9a"}},"homepage":"https://github.com/nilzona/path2d-polyfill#readme","keywords":["Path2D","polyfill","canvas","roundRect"],"repository":{"url":"git+https://github.com/nilzona/path2d-polyfill.git","type":"git"},"description":"Polyfills Path2D api for canvas rendering","directories":{},"maintainers":[{"name":"nilzona_user","email":"nilssonanders79@gmail.com"}],"browserslist":[">0.1%","ie >= 11","last 2 versions","not dead"],"dependencies":{"path2d":"^0.3.5"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^8.3.8","jsdom":"^31.0.1","@babel/core":"^8.1.2","@babel/preset-env":"^8.0.7","@rollup/plugin-babel":"^7.1.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/path2d-polyfill_3.2.4_1794835515842_0.5077010193295721"},"readme":"# path2d-polyfill\n\n[![CI](https://github.com/nilzona/path2d-polyfill/actions/workflows/ci.yml/badge.svg)](https://github.com/nilzona/path2d-polyfill/actions/workflows/ci.yml)\n\nPolyfills `Path2D` api and `roundRect` for CanvasRenderingContext2D\n\n## Usage\n\nAdd this script tag to your page to enable the feature.\n\n```html\n<script lang=\"javascript\" src=\"https://cdn.jsdelivr.net/npm/path2d-polyfill/dist/path2d-polyfill.min.js\"></script>\n```\n\nThis will polyfill the browser's window object with Path2D features and it will also polyfill roundRect if they are missing in both CanvasRenderingContexst and Path2D.\n\nExample of usage\n\n```javascript\nctx.fill(new Path2D(\"M 80 80 A 45 45 0 0 0 125 125 L 125 80 Z\"));\nctx.stroke(new Path2D(\"M 80 80 A 45 45 0 0 0 125 125 L 125 80 Z\"));\n\n// or ...\nconst path = new Path2D();\npath.roundRect(10, 10, 100, 60, { x: 20, y: 10 }); // Elliptical corners\nctx.stroke(path);\n\n// Mixed corner types\nconst path2 = new Path2D();\npath2.roundRect(10, 10, 100, 60, [{ x: 15, y: 5 }, 10, { x: 5, y: 15 }, 8]);\nctx.stroke(path2);\n```\n\n## Support table\n\n| Method               | Supported |\n| -------------------- | :-------: |\n| constructor(SVGPath) |    Yes    |\n| addPath()            |    Yes    |\n| closePath()          |    Yes    |\n| moveTo()             |    Yes    |\n| lineTo()             |    Yes    |\n| bezierCurveTo()      |    Yes    |\n| quadraticCurveTo()   |    Yes    |\n| arc()                |    Yes    |\n| ellipse()            |    Yes    |\n| rect()               |    Yes    |\n| roundRect()          |    Yes    |\n\n## See it in action\n\nClone [path2d-polyfill](https://github.com/nilzona/path2d-polyfill)\n\n```shell\npnpm install\npnpm dev\n```\n\nopen <http://localhost:5173/> to see the example page.\n\n## Contributing\n\nRecommended to use vscode with the prettier extension to keep formatting intact.\n","publish_time":1794835515954,"_cnpm_publish_time":1794835515954,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}