@freesewing/plugin-round
Advanced tools
+3
-3
| /** | ||
| * @freesewing/plugin-round | v0.2.0 | ||
| * @freesewing/plugin-round | v0.3.0 | ||
| * A freesewing plugin to round corners | ||
| * (c) 2018 Joost De Cock <joost@decock.org> (https://github.com/joostdecock) | ||
| * (c) 2019 Joost De Cock <joost@decock.org> (https://github.com/joostdecock) | ||
| * @license MIT | ||
| */ | ||
| this.freesewing=this.freesewing||{},this.freesewing.plugins=this.freesewing.plugins||{},this.freesewing.plugins.round=function(){"use strict";function t(s){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(s)}return{name:"@freesewing/plugin-round",version:"0.2.0",hooks:{preRender:function(t){!1===t.attributes.get("freesewing:plugin-round")&&t.attributes.set("freesewing:plugin-round","0.2.0")}},macros:{round:function(s){var e=.55191502449,n=s.from,i=s.to,r=s.via,o=s.radius,u=s.prefix;if((n.angle(r)-r.angle(i))%90!=0)throw new Error("The tound macro currently only supports 90 degree angles.");var p=n.dist(r),d=i.dist(r);(o>p||o>d||void 0===o)&&(o=p>d?d:p),this.points[u+"Start"]=r.shiftTowards(n,o),this.points[u+"Cp1"]=r.shiftTowards(n,o*(1-e)),this.points[u+"Cp2"]=r.shiftTowards(i,o*(1-e)),this.points[u+"End"]=r.shiftTowards(i,o),this.paths[u+"Rounded"]=(new this.Path).move(this.points[u+"Start"]).curve(this.points[u+"Cp1"],this.points[u+"Cp2"],this.points[u+"End"]).attr("class",s.class?s.class:""),void 0!==t(s.render)&&s.render?this.paths[u+"Rounded"].render=!0:this.paths[u+"Rounded"].render=!1}}}}(); | ||
| this.freesewing=this.freesewing||{},this.freesewing.plugins=this.freesewing.plugins||{},this.freesewing.plugins.round=function(){"use strict";function t(n){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(n)}return{name:"@freesewing/plugin-round",version:"0.3.0",hooks:{preRender:function(t){!1===t.attributes.get("freesewing:plugin-round")&&t.attributes.set("freesewing:plugin-round","0.3.0")}},macros:{round:function(n){var s=.55191502449,e=n.from,r=n.to,i=n.via,o=n.radius,u=n.prefix,p=e.angle(i),d=i.angle(r);if((Math.round(p)-Math.round(d))%90!=0)throw new Error("The round macro currently only supports 90 degree angles.");var h=e.dist(i),a=r.dist(i);(o>h||o>a||void 0===o)&&(o=h>a?a:h),this.points[u+"Start"]=i.shiftTowards(e,o),this.points[u+"Cp1"]=i.shiftTowards(e,o*(1-s)),this.points[u+"Cp2"]=i.shiftTowards(r,o*(1-s)),this.points[u+"End"]=i.shiftTowards(r,o),this.paths[u+"Rounded"]=(new this.Path).move(this.points[u+"Start"]).curve(this.points[u+"Cp1"],this.points[u+"Cp2"],this.points[u+"End"]).attr("class",n.class?n.class:""),void 0!==t(n.render)&&n.render?this.paths[u+"Rounded"].render=!0:this.paths[u+"Rounded"].render=!1}}}}(); |
+3
-3
| /** | ||
| * @freesewing/plugin-round | v0.2.0 | ||
| * @freesewing/plugin-round | v0.3.0 | ||
| * A freesewing plugin to round corners | ||
| * (c) 2018 Joost De Cock <joost@decock.org> (https://github.com/joostdecock) | ||
| * (c) 2019 Joost De Cock <joost@decock.org> (https://github.com/joostdecock) | ||
| * @license MIT | ||
| */ | ||
| "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var name="@freesewing/plugin-round",version="0.2.0",index={name:name,version:version,hooks:{preRender:function(t){!1===t.attributes.get("freesewing:plugin-round")&&t.attributes.set("freesewing:plugin-round",version)}},macros:{round:function(t){var o=.55191502449,e=t.from,n=t.to,s=t.via,r=t.radius,i=t.prefix;if((e.angle(s)-s.angle(n))%90!=0)throw new Error("The tound macro currently only supports 90 degree angles.");var p=e.dist(s),d=n.dist(s);(r>p||r>d||void 0===r)&&(r=p>d?d:p),this.points[i+"Start"]=s.shiftTowards(e,r),this.points[i+"Cp1"]=s.shiftTowards(e,r*(1-o)),this.points[i+"Cp2"]=s.shiftTowards(n,r*(1-o)),this.points[i+"End"]=s.shiftTowards(n,r),this.paths[i+"Rounded"]=(new this.Path).move(this.points[i+"Start"]).curve(this.points[i+"Cp1"],this.points[i+"Cp2"],this.points[i+"End"]).attr("class",t.class?t.class:""),void 0!==_typeof(t.render)&&t.render?this.paths[i+"Rounded"].render=!0:this.paths[i+"Rounded"].render=!1}}};module.exports=index; | ||
| "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var name="@freesewing/plugin-round",version="0.3.0",index={name:name,version:version,hooks:{preRender:function(t){!1===t.attributes.get("freesewing:plugin-round")&&t.attributes.set("freesewing:plugin-round",version)}},macros:{round:function(t){var o=.55191502449,e=t.from,n=t.to,r=t.via,s=t.radius,i=t.prefix,d=e.angle(r),p=r.angle(n);if((Math.round(d)-Math.round(p))%90!=0)throw new Error("The round macro currently only supports 90 degree angles.");var a=e.dist(r),u=n.dist(r);(s>a||s>u||void 0===s)&&(s=a>u?u:a),this.points[i+"Start"]=r.shiftTowards(e,s),this.points[i+"Cp1"]=r.shiftTowards(e,s*(1-o)),this.points[i+"Cp2"]=r.shiftTowards(n,s*(1-o)),this.points[i+"End"]=r.shiftTowards(n,s),this.paths[i+"Rounded"]=(new this.Path).move(this.points[i+"Start"]).curve(this.points[i+"Cp1"],this.points[i+"Cp2"],this.points[i+"End"]).attr("class",t.class?t.class:""),void 0!==_typeof(t.render)&&t.render?this.paths[i+"Rounded"].render=!0:this.paths[i+"Rounded"].render=!1}}};module.exports=index; |
+3
-3
| /** | ||
| * @freesewing/plugin-round | v0.2.0 | ||
| * @freesewing/plugin-round | v0.3.0 | ||
| * A freesewing plugin to round corners | ||
| * (c) 2018 Joost De Cock <joost@decock.org> (https://github.com/joostdecock) | ||
| * (c) 2019 Joost De Cock <joost@decock.org> (https://github.com/joostdecock) | ||
| * @license MIT | ||
| */ | ||
| function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var name="@freesewing/plugin-round",version="0.2.0",index={name:name,version:version,hooks:{preRender:function(t){!1===t.attributes.get("freesewing:plugin-round")&&t.attributes.set("freesewing:plugin-round",version)}},macros:{round:function(t){var o=.55191502449,e=t.from,n=t.to,r=t.via,s=t.radius,i=t.prefix;if((e.angle(r)-r.angle(n))%90!=0)throw new Error("The tound macro currently only supports 90 degree angles.");var p=e.dist(r),a=n.dist(r);(s>p||s>a||void 0===s)&&(s=p>a?a:p),this.points[i+"Start"]=r.shiftTowards(e,s),this.points[i+"Cp1"]=r.shiftTowards(e,s*(1-o)),this.points[i+"Cp2"]=r.shiftTowards(n,s*(1-o)),this.points[i+"End"]=r.shiftTowards(n,s),this.paths[i+"Rounded"]=(new this.Path).move(this.points[i+"Start"]).curve(this.points[i+"Cp1"],this.points[i+"Cp2"],this.points[i+"End"]).attr("class",t.class?t.class:""),void 0!==_typeof(t.render)&&t.render?this.paths[i+"Rounded"].render=!0:this.paths[i+"Rounded"].render=!1}}};export default index; | ||
| function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var name="@freesewing/plugin-round",version="0.3.0",index={name:name,version:version,hooks:{preRender:function(t){!1===t.attributes.get("freesewing:plugin-round")&&t.attributes.set("freesewing:plugin-round",version)}},macros:{round:function(t){var o=.55191502449,n=t.from,e=t.to,r=t.via,s=t.radius,i=t.prefix,a=n.angle(r),d=r.angle(e);if((Math.round(a)-Math.round(d))%90!=0)throw new Error("The round macro currently only supports 90 degree angles.");var p=n.dist(r),u=e.dist(r);(s>p||s>u||void 0===s)&&(s=p>u?u:p),this.points[i+"Start"]=r.shiftTowards(n,s),this.points[i+"Cp1"]=r.shiftTowards(n,s*(1-o)),this.points[i+"Cp2"]=r.shiftTowards(e,s*(1-o)),this.points[i+"End"]=r.shiftTowards(e,s),this.paths[i+"Rounded"]=(new this.Path).move(this.points[i+"Start"]).curve(this.points[i+"Cp1"],this.points[i+"Cp2"],this.points[i+"End"]).attr("class",t.class?t.class:""),void 0!==_typeof(t.render)&&t.render?this.paths[i+"Rounded"].render=!0:this.paths[i+"Rounded"].render=!1}}};export default index; |
+15
-15
| { | ||
| "name": "@freesewing/plugin-round", | ||
| "version": "0.2.0", | ||
| "version": "0.3.0", | ||
| "description": "A freesewing plugin to round corners", | ||
@@ -49,23 +49,23 @@ "author": "Joost De Cock <joost@decock.org> (https://github.com/joostdecock)", | ||
| "devDependencies": { | ||
| "@babel/core": "^7.1.0", | ||
| "@babel/preset-env": "^7.1.0", | ||
| "@babel/register": "^7.0.0", | ||
| "@babel/core": "7.3.3", | ||
| "@babel/preset-env": "7.3.1", | ||
| "@babel/register": "7.4.0", | ||
| "chai": "^4.1.2", | ||
| "chai-string": "1.4.0", | ||
| "codecov": "^3.1.0", | ||
| "eslint": "^5.2.0", | ||
| "eslint-config-prettier": "^2.9.0", | ||
| "eslint-plugin-prettier": "^2.6.2", | ||
| "codecov": "3.2.0", | ||
| "eslint": "5.14.0", | ||
| "eslint-config-prettier": "2.10.0", | ||
| "eslint-plugin-prettier": "2.7.0", | ||
| "freesewing": "^0.24", | ||
| "husky": "^0.14.3", | ||
| "lint-staged": "^7.2.0", | ||
| "lint-staged": "7.3.0", | ||
| "mocha": "^5.2.0", | ||
| "nyc": "12.0.2", | ||
| "prettier": "^1.13.7", | ||
| "rimraf": "^2.6.2", | ||
| "nyc": "13.3.0", | ||
| "prettier": "1.16.4", | ||
| "rimraf": "2.6.3", | ||
| "rollup": "^0.66.2", | ||
| "rollup-plugin-babel": "^4.0.3", | ||
| "rollup-plugin-babel": "4.3.2", | ||
| "rollup-plugin-filesize": "^4.0.1", | ||
| "rollup-plugin-json": "^3.0.0", | ||
| "rollup-plugin-node-resolve": "^3.3.0", | ||
| "rollup-plugin-json": "3.1.0", | ||
| "rollup-plugin-node-resolve": "3.4.0", | ||
| "rollup-plugin-terser": "^1.0.1" | ||
@@ -72,0 +72,0 @@ }, |
Sorry, the diff of this file is too big to display
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
240301
-34.81%6461
-35.79%