{"name":"path2d-polyfill","version":"1.2.2","keywords":["Path2D","polyfill","canvas"],"author":{"name":"nilzona"},"license":"MIT","_id":"path2d-polyfill@1.2.2","maintainers":[{"name":"nilzona","email":"nilssonanders79@gmail.com"}],"homepage":"https://github.com/nilzona/path2d-polyfill#readme","bugs":{"url":"https://github.com/nilzona/path2d-polyfill/issues"},"dist":{"shasum":"08c884e3bfe87570a89b63a9bf400665cd966c5b","tarball":"http://registry-npm.ywwl.com/path2d-polyfill/download/path2d-polyfill-1.2.2.tgz","fileCount":14,"integrity":"sha512-ToBPvOQrW876CpNH2HYanjwc4td3oZDeqtElUlwf/EzvhxlBfiWpwcqWs2JgNoMITTceeW4diCTnzzxslG+D8w==","signatures":[{"sig":"MEUCIQCsfwUdztaWoesp+V6JLqZpAcToedKTHrs56vo0BGf0wwIgC0ttt+9CONI2g3X3XuDaSy8oQUKJASH9kOCbOhf5tLs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":106321,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3GgYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrTERAAojEPPSbrYlX0Ix8Iff75qWyXqKeqthH4BUdjCK+kNmfm5+uM\r\npVBlS6HtK3iRHiHzctqrww68hP57LXlCzHz4vpE3tgetUzX2Hs68dK9Erfjs\r\njzxlTPjpFVsXtjad3wrg9YZGvxWkfIkvDIJQnkZzrqBTu83c9wZC1xPyMjxG\r\ns9dh/QXe/KOvuk3E2BSwajVWAP36kw3Vnyh/y8OxrZ14wjWX+BgD3r3QzdSF\r\nhLhRzM1VswpSGpQT55nNZW5YuVWaVDBgHpEXUBvTZQJimqwcz6tpTyj6cm0Y\r\nOZxDZJQDXTLFTbxbNKvM7wji/I127D03jUTQQwwOrUaU8Hkmj/YPjmlrZeQ6\r\nBRqPtJTHBCbiBrl5DispteIs1TE8DBieHAA8dlS51UFWqefg9PmC0O/Kq8Us\r\nEm2nMxd4GQcOP9efIle2mh1mA430U8ynPtin2dwby7yj7J/Ms9RygNsqrgoO\r\nD7bGjoAbDxBEqA7qbZmHPCNYQ7GA6WxFlC3199OXG5DXYkeE1LlQ8ZLc1ZiN\r\n4jKyv4LtVtTDizGR4uju6l53ZvUzoWgLnNLrjG9gQJVezOq3DCv3TVhyz4lt\r\nhsRFaTjZfVoVAybtkzFshhPAFdVYkAN0K3mJwpHEc9Xn0rfyzaAAQRqLth80\r\nEJbwq3aInPsNRXT+3jgK+HDgKHz2RlL4r0Y=\r\n=vfzm\r\n-----END PGP SIGNATURE-----\r\n","size":25849,"noattachment":false,"key":"/path2d-polyfill/-/path2d-polyfill-1.2.2.tgz"},"main":"dist/index.js","module":"dist/index.esm.js","scripts":{"lint":"eslint src test","test":"nyc --reporter=html --reporter=text mocha","build":"rm -rf dist/* && rollup -c","start":"rollup -c -w","prepare":"husky install","release":"release-it","format:check":"prettier --check \"./**\"","format:write":"prettier --write \"./**\""},"_npmUser":{"name":"nilzona","email":"nilssonanders79@gmail.com"},"repository":{"url":"git+https://github.com/nilzona/path2d-polyfill.git","type":"git"},"description":"Polyfills Path2D api for canvas rendering","directories":{},"licenseText":"MIT License\n\nCopyright (c) 2018 Anders Nilsson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.0.1","chai":"^4.3.6","husky":"^8.0.1","mocha":"^10.0.0","sinon":"^14.0.0","eslint":"^8.20.0","rollup":"^2.77.0","prettier":"^2.7.1","release-it":"^15.1.3","sinon-chai":"^3.7.0","@babel/core":"^7.18.9","lint-staged":"^13.0.3","@commitlint/cli":"^17.0.3","@babel/preset-env":"^7.18.9","rollup-plugin-serve":"^2.0.0","@rollup/plugin-babel":"^5.3.1","rollup-plugin-terser":"7.0.2","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.2.1","@rollup/plugin-commonjs":"^22.0.1","rollup-plugin-livereload":"^2.0.5","@commitlint/config-conventional":"^17.0.3","@release-it/conventional-changelog":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/path2d-polyfill_1.2.2_1658611735951_0.2825940895419017","host":"s3://npm-registry-packages"},"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":1658611736097,"_cnpm_publish_time":1658611736097,"dist-tags":{"beta":"2.0.0-beta.0","latest":"3.2.4"}}