Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@freesewing/plugin-round

Package Overview
Dependencies
Maintainers
1
Versions
302
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@freesewing/plugin-round - npm Package Compare versions

Comparing version
2.0.0-beta.0
to
2.0.0-beta.1
+2
-2
dist/index.js
/**
* @freesewing/plugin-round | v2.0.0-alpha.25
* @freesewing/plugin-round | v2.0.0-beta.1
* A FreeSewing plugin to round corners
* (c) 2019 Joost De Cock <joost@decock.org> (https://github.com/joostdecock)
* @license MIT
*/'use strict';var name="@freesewing/plugin-round",version="2.0.0-alpha.25",index={name:"@freesewing/plugin-round",version:version,hooks:{preRender:function(a){!1===a.attributes.get("freesewing:plugin-round")&&a.attributes.set("freesewing:plugin-round",version)}},macros:{round:function(a){var b=Math.round,c=.55191502449,d=a.from,e=a.to,f=a.via,g=a.radius,h=a.prefix,i=d.angle(f),j=f.angle(e);if(0!=(b(i)-b(j))%90)throw new Error("The round macro currently only supports 90 degree angles.");var k=d.dist(f),l=e.dist(f);(g>k||g>l||"undefined"==typeof g)&&(g=k>l?l:k),this.points[h+"Start"]=f.shiftTowards(d,g),this.points[h+"Cp1"]=f.shiftTowards(d,g*(1-c)),this.points[h+"Cp2"]=f.shiftTowards(e,g*(1-c)),this.points[h+"End"]=f.shiftTowards(e,g),this.paths[h+"Rounded"]=new this.Path().move(this.points[h+"Start"]).curve(this.points[h+"Cp1"],this.points[h+"Cp2"],this.points[h+"End"]).attr("class",a["class"]?a["class"]:""),this.paths[h+"Rounded"].render=!!("undefined"!=typeof a.render&&a.render)}}};module.exports=index;
*/'use strict';var name="@freesewing/plugin-round",version="2.0.0-beta.1",index={name:"@freesewing/plugin-round",version:version,hooks:{preRender:function(a){!1===a.attributes.get("freesewing:plugin-round")&&a.attributes.set("freesewing:plugin-round",version)}},macros:{round:function(a){var b=Math.round,c=.55191502449,d=a.from,e=a.to,f=a.via,g=a.radius,h=a.prefix,i=d.angle(f),j=f.angle(e);if(0!=(b(i)-b(j))%90)throw new Error("The round macro currently only supports 90 degree angles.");var k=d.dist(f),l=e.dist(f);(g>k||g>l||"undefined"==typeof g)&&(g=k>l?l:k),this.points[h+"Start"]=f.shiftTowards(d,g),this.points[h+"Cp1"]=f.shiftTowards(d,g*(1-c)),this.points[h+"Cp2"]=f.shiftTowards(e,g*(1-c)),this.points[h+"End"]=f.shiftTowards(e,g),this.paths[h+"Rounded"]=new this.Path().move(this.points[h+"Start"]).curve(this.points[h+"Cp1"],this.points[h+"Cp2"],this.points[h+"End"]).attr("class",a["class"]?a["class"]:""),this.paths[h+"Rounded"].render=!!("undefined"!=typeof a.render&&a.render)}}};module.exports=index;
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sources":["../src/index.js"],"sourcesContent":["import { name, version } from \"../package.json\";\n\nexport default {\n name: name,\n version: version,\n hooks: {\n preRender: function(svg) {\n if (svg.attributes.get(\"freesewing:plugin-round\") === false)\n svg.attributes.set(\"freesewing:plugin-round\", version);\n }\n },\n macros: {\n round: function(so) {\n const C = 0.55191502449;\n // Find angle between points\n let from = so.from;\n let to = so.to;\n let via = so.via;\n let radius = so.radius;\n let prefix = so.prefix;\n let angle1 = from.angle(via);\n let angle2 = via.angle(to);\n if((Math.round(angle1)-Math.round(angle2))%90 !== 0)\n throw new Error(\"The round macro currently only supports 90 degree angles.\");\n let fd = from.dist(via);\n let td = to.dist(via);\n if(radius > fd || radius > td || typeof radius === \"undefined\")\n radius = fd > td ? td : fd;\n this.points[prefix+\"Start\"] = via.shiftTowards(from, radius);\n this.points[prefix+\"Cp1\"] = via.shiftTowards(from, radius*(1-C));\n this.points[prefix+\"Cp2\"] = via.shiftTowards(to, radius*(1-C));\n this.points[prefix+\"End\"] = via.shiftTowards(to, radius);\n this.paths[prefix+\"Rounded\"] = new this.Path()\n .move(this.points[prefix+\"Start\"])\n .curve(\n this.points[prefix+\"Cp1\"],\n this.points[prefix+\"Cp2\"],\n this.points[prefix+\"End\"]\n )\n .attr(\"class\", so.class ? so.class : \"\");\n if(typeof so.render !== \"undefined\" && so.render) this.paths[prefix+\"Rounded\"].render = true;\n else this.paths[prefix+\"Rounded\"].render = false;\n }\n }\n};\n"],"names":["name","version","hooks","preRender","svg","attributes","get","set","macros","round","so","Math","C","from","to","via","radius","prefix","angle1","angle","angle2","Error","fd","dist","td","points","shiftTowards","paths","Path","move","curve","attr","render"],"mappings":";;;;;mFAEe,CACbA,IAAI,2BADS,CAEbC,OAAO,CAAEA,OAFI,CAGbC,KAAK,CAAE,CACLC,SAAS,CAAE,SAASC,CAAT,CAAc,CACnBA,KAAAA,CAAG,CAACC,UAAJD,CAAeE,GAAfF,CAAmB,yBAAnBA,CADmB,EAErBA,CAAG,CAACC,UAAJD,CAAeG,GAAfH,CAAmB,yBAAnBA,CAA8CH,OAA9CG,EAHC,CAHM,CASbI,MAAM,CAAE,CACNC,KAAK,CAAE,SAASC,CAAT,CAAa,OAUdC,IAAI,CAACF,KAVS,CACZG,CAAC,CAAG,YADQ,CAGdC,CAAI,CAAGH,CAAE,CAACG,IAHI,CAIdC,CAAE,CAAGJ,CAAE,CAACI,EAJM,CAKdC,CAAG,CAAGL,CAAE,CAACK,GALK,CAMdC,CAAM,CAAGN,CAAE,CAACM,MANE,CAOdC,CAAM,CAAGP,CAAE,CAACO,MAPE,CAQdC,CAAM,CAAGL,CAAI,CAACM,KAALN,CAAWE,CAAXF,CARK,CASdO,CAAM,CAAGL,CAAG,CAACI,KAAJJ,CAAUD,CAAVC,CATK,IAUgC,CAA/C,GAACJ,EAAWO,CAAXP,EAAmBA,EAAWS,CAAXT,CAApB,EAAwC,GACzC,KAAM,IAAIU,CAAAA,KAAJ,CAAU,2DAAV,CAAN,CAXgB,GAYdC,CAAAA,CAAE,CAAGT,CAAI,CAACU,IAALV,CAAUE,CAAVF,CAZS,CAadW,CAAE,CAAGV,CAAE,CAACS,IAAHT,CAAQC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\n\nexport default {\n name: name,\n version: version,\n hooks: {\n preRender: function(svg) {\n if (svg.attributes.get(\"freesewing:plugin-round\") === false)\n svg.attributes.set(\"freesewing:plugin-round\", version);\n }\n },\n macros: {\n round: function(so) {\n const C = 0.55191502449;\n // Find angle between points\n let from = so.from;\n let to = so.to;\n let via = so.via;\n let radius = so.radius;\n let prefix = so.prefix;\n let angle1 = from.angle(via);\n let angle2 = via.angle(to);\n if ((Math.round(angle1) - Math.round(angle2)) % 90 !== 0)\n throw new Error(\n \"The round macro currently only supports 90 degree angles.\"\n );\n let fd = from.dist(via);\n let td = to.dist(via);\n if (radius > fd || radius > td || typeof radius === \"undefined\")\n radius = fd > td ? td : fd;\n this.points[prefix + \"Start\"] = via.shiftTowards(from, radius);\n this.points[prefix + \"Cp1\"] = via.shiftTowards(from, radius * (1 - C));\n this.points[prefix + \"Cp2\"] = via.shiftTowards(to, radius * (1 - C));\n this.points[prefix + \"End\"] = via.shiftTowards(to, radius);\n this.paths[prefix + \"Rounded\"] = new this.Path()\n .move(this.points[prefix + \"Start\"])\n .curve(\n this.points[prefix + \"Cp1\"],\n this.points[prefix + \"Cp2\"],\n this.points[prefix + \"End\"]\n )\n .attr(\"class\", so.class ? so.class : \"\");\n if (typeof so.render !== \"undefined\" && so.render)\n this.paths[prefix + \"Rounded\"].render = true;\n else this.paths[prefix + \"Rounded\"].render = false;\n }\n }\n};\n"],"names":["name","version","hooks","preRender","svg","attributes","get","set","macros","round","so","Math","C","from","to","via","radius","prefix","angle1","angle","angle2","Error","fd","dist","td","points","shiftTowards","paths","Path","move","curve","attr","render"],"mappings":";;;;;iFAEe,CACbA,IAAI,2BADS,CAEbC,OAAO,CAAEA,OAFI,CAGbC,KAAK,CAAE,CACLC,SAAS,CAAE,SAASC,CAAT,CAAc,CACnBA,KAAAA,CAAG,CAACC,UAAJD,CAAeE,GAAfF,CAAmB,yBAAnBA,CADmB,EAErBA,CAAG,CAACC,UAAJD,CAAeG,GAAfH,CAAmB,yBAAnB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OAASF,CAAG,CAACW,YAAJX,CAAiBD,CAAjBC,CAAqBC,CAArBD,CArBZ,MAsBbY,MAAMV,CAAM,CAAG,WAAa,GAAI,MAAKW,IAAT,GAC9BC,IAD8B,CACzB,KAAKJ,MAAL,CAAYR,CAAM,CAAG,OAArB,CADyB,EAE9Ba,KAF8B,CAG7B,KAAKL,MAAL,CAAYR,CAAM,CAAG,KAArB,CAH6B,CAI7B,KAAKQ,MAAL,CAAYR,CAAM,CAAG,KAArB,CAJ6B,CAK7B,KAAKQ,MAAL,CAAYR,CAAM,CAAG,KAArB,CAL6B,EAO9Bc,IAP8B,CAOzB,OAPyB,CAOhBrB,CAAE,QAAA,CAAFA,CAAWA,CAAE,QAAA,CAAbA,CAAsB,EAPN,CAtBf,CA+BhB,KAAKiB,KAAL,CAAWV,CAAM,CAAG,SAApB,EAA+Be,MA/Bf,IA8BO,WAArB,QAAOtB,CAAAA,CAAE,CAACsB,MAAV,EAAoCtB,CAAE,CAACsB,MA9BzB,EADd,CATK"}
/**
* @freesewing/plugin-round | v2.0.0-alpha.25
* @freesewing/plugin-round | v2.0.0-beta.1
* A FreeSewing plugin to round corners
* (c) 2019 Joost De Cock <joost@decock.org> (https://github.com/joostdecock)
* @license MIT
*/var name="@freesewing/plugin-round",version="2.0.0-alpha.25",index={name:"@freesewing/plugin-round",version:version,hooks:{preRender:function(a){!1===a.attributes.get("freesewing:plugin-round")&&a.attributes.set("freesewing:plugin-round",version)}},macros:{round:function(a){var b=Math.round,c=.55191502449,d=a.from,e=a.to,f=a.via,g=a.radius,h=a.prefix,i=d.angle(f),j=f.angle(e);if(0!=(b(i)-b(j))%90)throw new Error("The round macro currently only supports 90 degree angles.");var k=d.dist(f),l=e.dist(f);(g>k||g>l||"undefined"==typeof g)&&(g=k>l?l:k),this.points[h+"Start"]=f.shiftTowards(d,g),this.points[h+"Cp1"]=f.shiftTowards(d,g*(1-c)),this.points[h+"Cp2"]=f.shiftTowards(e,g*(1-c)),this.points[h+"End"]=f.shiftTowards(e,g),this.paths[h+"Rounded"]=new this.Path().move(this.points[h+"Start"]).curve(this.points[h+"Cp1"],this.points[h+"Cp2"],this.points[h+"End"]).attr("class",a["class"]?a["class"]:""),this.paths[h+"Rounded"].render=!!("undefined"!=typeof a.render&&a.render)}}};export default index;
*/var name="@freesewing/plugin-round",version="2.0.0-beta.1",index={name:"@freesewing/plugin-round",version:version,hooks:{preRender:function(a){!1===a.attributes.get("freesewing:plugin-round")&&a.attributes.set("freesewing:plugin-round",version)}},macros:{round:function(a){var b=Math.round,c=.55191502449,d=a.from,e=a.to,f=a.via,g=a.radius,h=a.prefix,i=d.angle(f),j=f.angle(e);if(0!=(b(i)-b(j))%90)throw new Error("The round macro currently only supports 90 degree angles.");var k=d.dist(f),l=e.dist(f);(g>k||g>l||"undefined"==typeof g)&&(g=k>l?l:k),this.points[h+"Start"]=f.shiftTowards(d,g),this.points[h+"Cp1"]=f.shiftTowards(d,g*(1-c)),this.points[h+"Cp2"]=f.shiftTowards(e,g*(1-c)),this.points[h+"End"]=f.shiftTowards(e,g),this.paths[h+"Rounded"]=new this.Path().move(this.points[h+"Start"]).curve(this.points[h+"Cp1"],this.points[h+"Cp2"],this.points[h+"End"]).attr("class",a["class"]?a["class"]:""),this.paths[h+"Rounded"].render=!!("undefined"!=typeof a.render&&a.render)}}};export default index;
//# sourceMappingURL=index.mjs.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.mjs","sources":["../src/index.js"],"sourcesContent":["import { name, version } from \"../package.json\";\n\nexport default {\n name: name,\n version: version,\n hooks: {\n preRender: function(svg) {\n if (svg.attributes.get(\"freesewing:plugin-round\") === false)\n svg.attributes.set(\"freesewing:plugin-round\", version);\n }\n },\n macros: {\n round: function(so) {\n const C = 0.55191502449;\n // Find angle between points\n let from = so.from;\n let to = so.to;\n let via = so.via;\n let radius = so.radius;\n let prefix = so.prefix;\n let angle1 = from.angle(via);\n let angle2 = via.angle(to);\n if((Math.round(angle1)-Math.round(angle2))%90 !== 0)\n throw new Error(\"The round macro currently only supports 90 degree angles.\");\n let fd = from.dist(via);\n let td = to.dist(via);\n if(radius > fd || radius > td || typeof radius === \"undefined\")\n radius = fd > td ? td : fd;\n this.points[prefix+\"Start\"] = via.shiftTowards(from, radius);\n this.points[prefix+\"Cp1\"] = via.shiftTowards(from, radius*(1-C));\n this.points[prefix+\"Cp2\"] = via.shiftTowards(to, radius*(1-C));\n this.points[prefix+\"End\"] = via.shiftTowards(to, radius);\n this.paths[prefix+\"Rounded\"] = new this.Path()\n .move(this.points[prefix+\"Start\"])\n .curve(\n this.points[prefix+\"Cp1\"],\n this.points[prefix+\"Cp2\"],\n this.points[prefix+\"End\"]\n )\n .attr(\"class\", so.class ? so.class : \"\");\n if(typeof so.render !== \"undefined\" && so.render) this.paths[prefix+\"Rounded\"].render = true;\n else this.paths[prefix+\"Rounded\"].render = false;\n }\n }\n};\n"],"names":["name","version","hooks","preRender","svg","attributes","get","set","macros","round","so","Math","C","from","to","via","radius","prefix","angle1","angle","angle2","Error","fd","dist","td","points","shiftTowards","paths","Path","move","curve","attr","render"],"mappings":";;;;;sEAEe,CACbA,IAAI,2BADS,CAEbC,OAAO,CAAEA,OAFI,CAGbC,KAAK,CAAE,CACLC,SAAS,CAAE,SAASC,CAAT,CAAc,CACnBA,KAAAA,CAAG,CAACC,UAAJD,CAAeE,GAAfF,CAAmB,yBAAnBA,CADmB,EAErBA,CAAG,CAACC,UAAJD,CAAeG,GAAfH,CAAmB,yBAAnBA,CAA8CH,OAA9CG,EAHC,CAHM,CASbI,MAAM,CAAE,CACNC,KAAK,CAAE,SAASC,CAAT,CAAa,OAUdC,IAAI,CAACF,KAVS,CACZG,CAAC,CAAG,YADQ,CAGdC,CAAI,CAAGH,CAAE,CAACG,IAHI,CAIdC,CAAE,CAAGJ,CAAE,CAACI,EAJM,CAKdC,CAAG,CAAGL,CAAE,CAACK,GALK,CAMdC,CAAM,CAAGN,CAAE,CAACM,MANE,CAOdC,CAAM,CAAGP,CAAE,CA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AAKQ,MAAL,CAAYR,CAAM,CAAC,KAAnB,CAL2B,EAO5Bc,IAP4B,CAOvB,OAPuB,CAOdrB,CAAE,QAAA,CAAFA,CAAWA,CAAE,QAAA,CAAbA,CAAsB,EAPR,CApBb,CA4BgC,KAAKiB,KAAL,CAAWV,CAAM,CAAC,SAAlB,EAA6Be,MA5B7D,IA4BM,WAArB,QAAOtB,CAAAA,CAAE,CAACsB,MAAV,EAAoCtB,CAAE,CAACsB,MA5BxB,EADd,CATK"}
{"version":3,"file":"index.mjs","sources":["../src/index.js"],"sourcesContent":["import { name, version } from \"../package.json\";\n\nexport default {\n name: name,\n version: version,\n hooks: {\n preRender: function(svg) {\n if (svg.attributes.get(\"freesewing:plugin-round\") === false)\n svg.attributes.set(\"freesewing:plugin-round\", version);\n }\n },\n macros: {\n round: function(so) {\n const C = 0.55191502449;\n // Find angle between points\n let from = so.from;\n let to = so.to;\n let via = so.via;\n let radius = so.radius;\n let prefix = so.prefix;\n let angle1 = from.angle(via);\n let angle2 = via.angle(to);\n if ((Math.round(angle1) - Math.round(angle2)) % 90 !== 0)\n throw new Error(\n \"The round macro currently only supports 90 degree angles.\"\n );\n let fd = from.dist(via);\n let td = to.dist(via);\n if (radius > fd || radius > td || typeof radius === \"undefined\")\n radius = fd > td ? td : fd;\n this.points[prefix + \"Start\"] = via.shiftTowards(from, radius);\n this.points[prefix + \"Cp1\"] = via.shiftTowards(from, radius * (1 - C));\n this.points[prefix + \"Cp2\"] = via.shiftTowards(to, radius * (1 - C));\n this.points[prefix + \"End\"] = via.shiftTowards(to, radius);\n this.paths[prefix + \"Rounded\"] = new this.Path()\n .move(this.points[prefix + \"Start\"])\n .curve(\n this.points[prefix + \"Cp1\"],\n this.points[prefix + \"Cp2\"],\n this.points[prefix + \"End\"]\n )\n .attr(\"class\", so.class ? so.class : \"\");\n if (typeof so.render !== \"undefined\" && so.render)\n this.paths[prefix + \"Rounded\"].render = true;\n else this.paths[prefix + \"Rounded\"].render = false;\n }\n }\n};\n"],"names":["name","version","hooks","preRender","svg","attributes","get","set","macros","round","so","Math","C","from","to","via","radius","prefix","angle1","angle","angle2","Error","fd","dist","td","points","shiftTowards","paths","Path","move","curve","attr","render"],"mappings":";;;;;oEAEe,CACbA,IAAI,2BADS,CAEbC,OAAO,CAAEA,OAFI,CAGbC,KAAK,CAAE,CACLC,SAAS,CAAE,SAASC,CAAT,CAAc,CACnBA,KAAAA,CAAG,CAACC,UAAJD,CAAeE,GAAfF,CAAmB,yBAAnBA,CADmB,EAErBA,CAAG,CAACC,UAAJD,CAAeG,GAAfH,CAAmB,yBAAnBA,CAA8CH,OAA9CG,EAHC,CAHM,CASbI,MAAM,CAAE,CACNC,KAAK,CAAE,SAASC,CAAT,CAAa,OAUbC,IAAI,CAACF,KAVQ,CACZG,CAAC,CAAG,YADQ,CAGdC,CAAI,CAAGH,CAAE,CAACG,IAHI,CAIdC,CAAE,CAAGJ,CAAE,CAACI,EAJM,CAKdC,CAAG,CAAGL,CAAE,CAACK,GALK,CAMdC,CAAM,CAAGN,CAAE,CAACM,MANE,CAOdC,CAAM,CAAGP,CAAE,CAACO,MAPE,CAQdC,CAAM,CAAGL,CAAI,CAACM,KAALN,CAAWE,CAAXF,CARK,CASdO,CAAM,CAAGL,CAAG,CAACI,KAAJJ,CAAUD,CAAVC,CATK,IAUqC,CAAnD,GAACJ,EAAWO,CAAXP,EAAqBA,EAAWS,CAAXT,CAAtB,EAA4C,GAC9C,KAAM,IAAIU,CAAAA,KAAJ,CACJ,2DADI,CAAN,CAXgB,GAcdC,CAAAA,CAAE,CAAGT,CAAI,CAACU,IAALV,CAAUE,CAAVF,CAdS,CAedW,CAAE,CAAGV,CAAE,CAACS,IAAHT,CAAQC,CAARD,CAfS,EAgBdE,CAAM,CAAGM,CAATN,EAAeA,CAAM,CAAGQ,CAAxBR,EAAgD,WAAlB,QAAOA,CAAAA,CAhBvB,IAiBhBA,CAAM,CAAGM,CAAE,CAAGE,CAALF,CAAUE,CAAVF,CAAeA,CAjBR,OAkBbG,OAAOR,CAAM,CAAG,SAAWF,CAAG,CAACW,YAAJX,CAAiBF,CAAjBE,CAAuBC,CAAvBD,CAlBd,MAmBbU,OAAOR,CAAM,CAAG,OAASF,CAAG,CAACW,YAAJX,CAAiBF,CAAjBE,CAAuBC,CAAM,EAAI,EAAIJ,CAAR,CAA7BG,CAnBZ,MAoBbU,OAAOR,CAAM,CAAG,OAASF,CAAG,CAACW,YAAJX,CAAiBD,CAAjBC,CAAqBC,CAAM,EAAI,EAAIJ,CAAR,CAA3BG,CApBZ,MAqBbU,OAAOR,CAAM,CAAG,OAASF,CAAG,CAACW,YAAJX,CAAiBD,CAAjBC,CAAqBC,CAArBD,CArBZ,MAsBbY,MAAMV,CAAM,CAAG,WAAa,GAAI,MAAKW,IAAT,GAC9BC,IAD8B,CACzB,KAAKJ,MAAL,CAAYR,CAAM,CAAG,OAArB,CADyB,EAE9Ba,KAF8B,CAG7B,KAAKL,MAAL,CAAYR,CAAM,CAAG,KAArB,CAH6B,CAI7B,KAAKQ,MAAL,CAAYR,CAAM,CAAG,KAArB,CAJ6B,CAK7B,KAAKQ,MAAL,CAAYR,CAAM,CAAG,KAArB,CAL6B,EAO9Bc,IAP8B,CAOzB,OAPyB,CAOhBrB,CAAE,QAAA,CAAFA,CAAWA,CAAE,QAAA,CAAbA,CAAsB,EAPN,CAtBf,CA+BhB,KAAKiB,KAAL,CAAWV,CAAM,CAAG,SAApB,EAA+Be,MA/Bf,IA8BO,WAArB,QAAOtB,CAAAA,CAAE,CAACsB,MAAV,EAAoCtB,CAAE,CAACsB,MA9BzB,EADd,CATK"}
{
"name": "@freesewing/plugin-round",
"version": "2.0.0-beta.0",
"version": "2.0.0-beta.1",
"description": "A FreeSewing plugin to round corners",

@@ -36,3 +36,3 @@ "author": "Joost De Cock <joost@decock.org> (https://github.com/joostdecock)",

"peerDependencies": {
"@freesewing/core": "^2.0.0-beta.0"
"@freesewing/core": "^2.0.0-beta.1"
},

@@ -39,0 +39,0 @@ "dependencies": {},