path2d-polyfill 3.1.2 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,6 +19,16 @@ Example of usage
19
19
  ```javascript
20
20
  ctx.fill(new Path2D("M 80 80 A 45 45 0 0 0 125 125 L 125 80 Z"));
21
21
  ctx.stroke(new Path2D("M 80 80 A 45 45 0 0 0 125 125 L 125 80 Z"));
22
+
23
+ // or ...
24
+ const path = new Path2D();
25
+ path.roundRect(10, 10, 100, 60, { x: 20, y: 10 }); // Elliptical corners
26
+ ctx.stroke(path);
27
+
28
+ // Mixed corner types
29
+ const path2 = new Path2D();
30
+ path2.roundRect(10, 10, 100, 60, [{ x: 15, y: 5 }, 10, { x: 5, y: 15 }, 8]);
31
+ ctx.stroke(path2);
22
32
  ```
23
33
 
24
34
  ## Support table
@@ -1 +1 @@
1
- (function(){"use strict";var M={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},V=/([astvzqmhlc])([^astvzqmhlc]*)/gi,Z=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function U(a){const r=a.match(Z);return r?r.map(Number):[]}function j(a){const r=[],t=String(a).trim();return t[0]!=="M"&&t[0]!=="m"||t.replace(V,(n,l,i)=>{const o=U(i);let s=l.toLowerCase(),u=l;if(s==="m"&&o.length>2&&(r.push([u,...o.splice(0,2)]),s="l",u=u==="m"?"l":"L"),o.length<M[s])return"";for(r.push([u,...o.splice(0,M[s])]);o.length>=M[s]&&o.length&&M[s];)r.push([u,...o.splice(0,M[s])]);return""}),r}function N(a,r){const t=a.x*Math.cos(r)-a.y*Math.sin(r),n=a.y*Math.cos(r)+a.x*Math.sin(r);a.x=t,a.y=n}function D(a,r,t){a.x+=r,a.y+=t}function S(a,r){a.x*=r,a.y*=r}var z=class L{constructor(r){this.commands=[],r&&r instanceof L?this.commands.push(...r.commands):r&&(this.commands=j(r))}addPath(r){r&&r instanceof L&&this.commands.push(...r.commands)}moveTo(r,t){this.commands.push(["M",r,t])}lineTo(r,t){this.commands.push(["L",r,t])}arc(r,t,n,l,i,o){this.commands.push(["AC",r,t,n,l,i,!!o])}arcTo(r,t,n,l,i){this.commands.push(["AT",r,t,n,l,i])}ellipse(r,t,n,l,i,o,s,u){this.commands.push(["E",r,t,n,l,i,o,s,!!u])}closePath(){this.commands.push(["Z"])}bezierCurveTo(r,t,n,l,i,o){this.commands.push(["C",r,t,n,l,i,o])}quadraticCurveTo(r,t,n,l){this.commands.push(["Q",r,t,n,l])}rect(r,t,n,l){this.commands.push(["R",r,t,n,l])}roundRect(r,t,n,l,i){typeof i>"u"?this.commands.push(["RR",r,t,n,l,0]):this.commands.push(["RR",r,t,n,l,i])}};function A(a,r){let t=0,n=0,l,i,o,s,u,c,b,v,k,q,Q,B,E,f,p,C,I,y,P,F,H,T=null,g=null,d=null,m=null,w=null,R=null;a.beginPath();for(let h=0;h<r.length;++h){y=r[h][0],y!=="S"&&y!=="s"&&y!=="C"&&y!=="c"&&(T=null,g=null),y!=="T"&&y!=="t"&&y!=="Q"&&y!=="q"&&(d=null,m=null);let e;switch(y){case"m":case"M":e=r[h],y==="m"?(t+=e[1],n+=e[2]):(t=e[1],n=e[2]),(y==="M"||!w)&&(w={x:t,y:n}),a.moveTo(t,n);break;case"l":e=r[h],t+=e[1],n+=e[2],a.lineTo(t,n);break;case"L":e=r[h],t=e[1],n=e[2],a.lineTo(t,n);break;case"H":e=r[h],t=e[1],a.lineTo(t,n);break;case"h":e=r[h],t+=e[1],a.lineTo(t,n);break;case"V":e=r[h],n=e[1],a.lineTo(t,n);break;case"v":e=r[h],n+=e[1],a.lineTo(t,n);break;case"a":case"A":if(e=r[h],R===null)throw new Error("This should never happen");y==="a"?(t+=e[6],n+=e[7]):(t=e[6],n=e[7]),f=e[1],p=e[2],b=e[3]*Math.PI/180,o=!!e[4],s=!!e[5],u={x:t,y:n},c={x:(R.x-u.x)/2,y:(R.y-u.y)/2},N(c,-b),v=c.x*c.x/(f*f)+c.y*c.y/(p*p),v>1&&(v=Math.sqrt(v),f*=v,p*=v),P={x:f*c.y/p,y:-(p*c.x)/f},k=f*f*p*p,q=f*f*c.y*c.y+p*p*c.x*c.x,s!==o?S(P,Math.sqrt((k-q)/q)||0):S(P,-Math.sqrt((k-q)/q)||0),i=Math.atan2((c.y-P.y)/p,(c.x-P.x)/f),l=Math.atan2(-(c.y+P.y)/p,-(c.x+P.x)/f),N(P,b),D(P,(u.x+R.x)/2,(u.y+R.y)/2),a.save(),a.translate(P.x,P.y),a.rotate(b),a.scale(f,p),a.arc(0,0,1,i,l,!s),a.restore();break;case"C":e=r[h],T=e[3],g=e[4],t=e[5],n=e[6],a.bezierCurveTo(e[1],e[2],T,g,t,n);break;case"c":e=r[h],a.bezierCurveTo(e[1]+t,e[2]+n,e[3]+t,e[4]+n,e[5]+t,e[6]+n),T=e[3]+t,g=e[4]+n,t+=e[5],n+=e[6];break;case"S":e=r[h],(T===null||g===null)&&(T=t,g=n),a.bezierCurveTo(2*t-T,2*n-g,e[1],e[2],e[3],e[4]),T=e[1],g=e[2],t=e[3],n=e[4];break;case"s":e=r[h],(T===null||g===null)&&(T=t,g=n),a.bezierCurveTo(2*t-T,2*n-g,e[1]+t,e[2]+n,e[3]+t,e[4]+n),T=e[1]+t,g=e[2]+n,t+=e[3],n+=e[4];break;case"Q":e=r[h],d=e[1],m=e[2],t=e[3],n=e[4],a.quadraticCurveTo(d,m,t,n);break;case"q":e=r[h],d=e[1]+t,m=e[2]+n,t+=e[3],n+=e[4],a.quadraticCurveTo(d,m,t,n);break;case"T":e=r[h],(d===null||m===null)&&(d=t,m=n),d=2*t-d,m=2*n-m,t=e[1],n=e[2],a.quadraticCurveTo(d,m,t,n);break;case"t":e=r[h],(d===null||m===null)&&(d=t,m=n),d=2*t-d,m=2*n-m,t+=e[1],n+=e[2],a.quadraticCurveTo(d,m,t,n);break;case"z":case"Z":w&&(t=w.x,n=w.y),w=null,a.closePath();break;case"AC":e=r[h],t=e[1],n=e[2],E=e[3],i=e[4],l=e[5],F=e[6],a.arc(t,n,E,i,l,F);break;case"AT":e=r[h],Q=e[1],B=e[2],t=e[3],n=e[4],E=e[5],a.arcTo(Q,B,t,n,E);break;case"E":e=r[h],t=e[1],n=e[2],f=e[3],p=e[4],b=e[5],i=e[6],l=e[7],F=e[8],a.save(),a.translate(t,n),a.rotate(b),a.scale(f,p),a.arc(0,0,1,i,l,F),a.restore();break;case"R":e=r[h],t=e[1],n=e[2],C=e[3],I=e[4],w={x:t,y:n},a.rect(t,n,C,I);break;case"RR":e=r[h],t=e[1],n=e[2],C=e[3],I=e[4],H=e[5],w={x:t,y:n},a.roundRect(t,n,C,I,H);break;default:throw new Error("Invalid path command: ".concat(y))}R?(R.x=t,R.y=n):R={x:t,y:n}}}function G(a,r,t,n){let l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(typeof l=="number"&&(l=[l]),Array.isArray(l)){if(l.length===0||l.length>4)throw new RangeError("Failed to execute 'roundRect' on '".concat(this.constructor.name,"': ").concat(l.length," radii provided. Between one and four radii are necessary."));l.forEach(b=>{if(b<0)throw new RangeError("Failed to execute 'roundRect' on '".concat(this.constructor.name,"': Radius value ").concat(b," is negative."))})}else return;if(l.length===1&&l[0]===0){this.rect(a,r,t,n);return}const i=Math.min(t,n)/2,o=Math.min(i,l[0]);let s=o,u=o,c=o;l.length===2&&(s=Math.min(i,l[1]),c=s),l.length===3&&(s=Math.min(i,l[1]),c=s,u=Math.min(i,l[2])),l.length===4&&(s=Math.min(i,l[1]),u=Math.min(i,l[2]),c=Math.min(i,l[3])),this.moveTo(a,r+n-c),this.arcTo(a,r,a+o,r,o),this.arcTo(a+t,r,a+t,r+s,s),this.arcTo(a+t,r+n,a+t-u,r+n,u),this.arcTo(a,r+n,a,r+n-c,c),this.moveTo(a,r)}function J(a){if(!a)return;const r=a.prototype.clip,t=a.prototype.fill,n=a.prototype.stroke,l=a.prototype.isPointInPath;a.prototype.clip=function(){if((arguments.length<=0?void 0:arguments[0])instanceof z){const s=arguments.length<=0?void 0:arguments[0],u=(arguments.length<=1?void 0:arguments[1])||"nonzero";return A(this,s.commands),r.apply(this,[u])}const o=(arguments.length<=0?void 0:arguments[0])||"nonzero";return r.apply(this,[o])},a.prototype.fill=function(){if((arguments.length<=0?void 0:arguments[0])instanceof z){const s=arguments.length<=0?void 0:arguments[0],u=(arguments.length<=1?void 0:arguments[1])||"nonzero";return A(this,s.commands),t.apply(this,[u])}const o=(arguments.length<=0?void 0:arguments[0])||"nonzero";return t.apply(this,[o])},a.prototype.stroke=function(o){o&&A(this,o.commands),n.apply(this)},a.prototype.isPointInPath=function(){for(var o=arguments.length,s=new Array(o),u=0;u<o;u++)s[u]=arguments[u];if(s[0]instanceof z){const c=s[0],b=s[1],v=s[2],k=s[3]||"nonzero";return A(this,c.commands),l.apply(this,[b,v,k])}return l.apply(this,s)}}function K(a){a&&!a.prototype.roundRect&&(a.prototype.roundRect=G)}function O(a){a&&!a.prototype.roundRect&&(a.prototype.roundRect=G)}function W(){window&&(window.CanvasRenderingContext2D&&!window.Path2D&&(window.Path2D=z,J(window.CanvasRenderingContext2D)),O(window.Path2D),K(window.CanvasRenderingContext2D))}W()})();
1
+ var X=b=>{throw TypeError(b)};var Y=(b,M,v)=>M.has(b)||X("Cannot "+v);var h=(b,M,v)=>(Y(b,M,"read from private field"),v?v.call(b):M.get(b)),_=(b,M,v)=>M.has(b)?X("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(b):M.set(b,v),Q=(b,M,v,$)=>(Y(b,M,"write to private field"),$?$.call(b,v):M.set(b,v),v);(function(){"use strict";var i;const b={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},M=/([astvzqmhlc])([^astvzqmhlc]*)/gi,v=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function $(s){const t=s.match(v);return t?t.map(Number):[]}function J(s){const t=[],n=String(s).trim();return n[0]!=="M"&&n[0]!=="m"||n.replace(M,(o,r,a)=>{const l=$(a);let f=r.toLowerCase(),c=r;if(f==="m"&&l.length>2&&(t.push([c,...l.splice(0,2)]),f="l",c=c==="m"?"l":"L"),l.length<b[f])return"";for(t.push([c,...l.splice(0,b[f])]);l.length>=b[f]&&l.length&&b[f];)t.push([c,...l.splice(0,b[f])]);return""}),t}function j(s,t){const n=s.x*Math.cos(t)-s.y*Math.sin(t),o=s.y*Math.cos(t)+s.x*Math.sin(t);s.x=n,s.y=o}function K(s,t,n){s.x+=t,s.y+=n}function B(s,t){s.x*=t,s.y*=t}const F=class F{constructor(t){_(this,i);Q(this,i,[]),t&&t instanceof F?h(this,i).push(...h(t,i)):t&&Q(this,i,J(t))}addCustomCommand(t){h(this,i).push(t)}addPath(t){t&&t instanceof F&&h(this,i).push(...h(t,i))}moveTo(t,n){h(this,i).push(["M",t,n])}lineTo(t,n){h(this,i).push(["L",t,n])}arc(t,n,o,r,a,l){h(this,i).push(["AC",t,n,o,r,a,!!l])}arcTo(t,n,o,r,a){h(this,i).push(["AT",t,n,o,r,a])}ellipse(t,n,o,r,a,l,f,c){h(this,i).push(["E",t,n,o,r,a,l,f,!!c])}closePath(){h(this,i).push(["Z"])}bezierCurveTo(t,n,o,r,a,l){h(this,i).push(["C",t,n,o,r,a,l])}quadraticCurveTo(t,n,o,r){h(this,i).push(["Q",t,n,o,r])}rect(t,n,o,r){h(this,i).push(["R",t,n,o,r])}roundRect(t,n,o,r,a){typeof a>"u"?h(this,i).push(["RR",t,n,o,r,0]):h(this,i).push(["RR",t,n,o,r,a])}buildPathInCanvas(t){let n=0,o=0,r,a,l,f,c,u,p,m,z,k,V,Z,L,T,d,N,S,x,q,G,U,w=null,I=null,P=null,R=null,C=null,A=null;t.beginPath();for(let y=0;y<h(this,i).length;++y){x=h(this,i)[y][0],x!=="S"&&x!=="s"&&x!=="C"&&x!=="c"&&(w=null,I=null),x!=="T"&&x!=="t"&&x!=="Q"&&x!=="q"&&(P=null,R=null);let e;switch(x){case"m":case"M":e=h(this,i)[y],x==="m"?(n+=e[1],o+=e[2]):(n=e[1],o=e[2]),(x==="M"||!C)&&(C={x:n,y:o}),t.moveTo(n,o);break;case"l":e=h(this,i)[y],n+=e[1],o+=e[2],t.lineTo(n,o);break;case"L":e=h(this,i)[y],n=e[1],o=e[2],t.lineTo(n,o);break;case"H":e=h(this,i)[y],n=e[1],t.lineTo(n,o);break;case"h":e=h(this,i)[y],n+=e[1],t.lineTo(n,o);break;case"V":e=h(this,i)[y],o=e[1],t.lineTo(n,o);break;case"v":e=h(this,i)[y],o+=e[1],t.lineTo(n,o);break;case"a":case"A":if(e=h(this,i)[y],A===null)throw new Error("This should never happen");x==="a"?(n+=e[6],o+=e[7]):(n=e[6],o=e[7]),T=e[1],d=e[2],p=e[3]*Math.PI/180,l=!!e[4],f=!!e[5],c={x:n,y:o},u={x:(A.x-c.x)/2,y:(A.y-c.y)/2},j(u,-p),m=u.x*u.x/(T*T)+u.y*u.y/(d*d),m>1&&(m=Math.sqrt(m),T*=m,d*=m),q={x:T*u.y/d,y:-(d*u.x)/T},z=T*T*d*d,k=T*T*u.y*u.y+d*d*u.x*u.x,f!==l?B(q,Math.sqrt((z-k)/k)||0):B(q,-Math.sqrt((z-k)/k)||0),a=Math.atan2((u.y-q.y)/d,(u.x-q.x)/T),r=Math.atan2(-(u.y+q.y)/d,-(u.x+q.x)/T),j(q,p),K(q,(c.x+A.x)/2,(c.y+A.y)/2),t.save(),t.translate(q.x,q.y),t.rotate(p),t.scale(T,d),t.arc(0,0,1,a,r,!f),t.restore();break;case"C":e=h(this,i)[y],w=e[3],I=e[4],n=e[5],o=e[6],t.bezierCurveTo(e[1],e[2],w,I,n,o);break;case"c":e=h(this,i)[y],t.bezierCurveTo(e[1]+n,e[2]+o,e[3]+n,e[4]+o,e[5]+n,e[6]+o),w=e[3]+n,I=e[4]+o,n+=e[5],o+=e[6];break;case"S":e=h(this,i)[y],(w===null||I===null)&&(w=n,I=o),t.bezierCurveTo(2*n-w,2*o-I,e[1],e[2],e[3],e[4]),w=e[1],I=e[2],n=e[3],o=e[4];break;case"s":e=h(this,i)[y],(w===null||I===null)&&(w=n,I=o),t.bezierCurveTo(2*n-w,2*o-I,e[1]+n,e[2]+o,e[3]+n,e[4]+o),w=e[1]+n,I=e[2]+o,n+=e[3],o+=e[4];break;case"Q":e=h(this,i)[y],P=e[1],R=e[2],n=e[3],o=e[4],t.quadraticCurveTo(P,R,n,o);break;case"q":e=h(this,i)[y],P=e[1]+n,R=e[2]+o,n+=e[3],o+=e[4],t.quadraticCurveTo(P,R,n,o);break;case"T":e=h(this,i)[y],(P===null||R===null)&&(P=n,R=o),P=2*n-P,R=2*o-R,n=e[1],o=e[2],t.quadraticCurveTo(P,R,n,o);break;case"t":e=h(this,i)[y],(P===null||R===null)&&(P=n,R=o),P=2*n-P,R=2*o-R,n+=e[1],o+=e[2],t.quadraticCurveTo(P,R,n,o);break;case"z":case"Z":C&&(n=C.x,o=C.y),C=null,t.closePath();break;case"AC":e=h(this,i)[y],n=e[1],o=e[2],L=e[3],a=e[4],r=e[5],G=e[6],t.arc(n,o,L,a,r,G);break;case"AT":e=h(this,i)[y],V=e[1],Z=e[2],n=e[3],o=e[4],L=e[5],t.arcTo(V,Z,n,o,L);break;case"E":e=h(this,i)[y],n=e[1],o=e[2],T=e[3],d=e[4],p=e[5],a=e[6],r=e[7],G=e[8],t.save(),t.translate(n,o),t.rotate(p),t.scale(T,d),t.arc(0,0,1,a,r,G),t.restore();break;case"R":e=h(this,i)[y],n=e[1],o=e[2],N=e[3],S=e[4],C={x:n,y:o},t.rect(n,o,N,S);break;case"RR":e=h(this,i)[y],n=e[1],o=e[2],N=e[3],S=e[4],U=e[5],C={x:n,y:o},t.roundRect(n,o,N,S,U);break;default:throw new Error(`Invalid path command: ${x}`)}A?(A.x=n,A.y=o):A={x:n,y:o}}}};i=new WeakMap;let E=F;function H(s){return s!==null&&typeof s=="object"&&("x"in s||"y"in s)&&(typeof s.x=="number"||typeof s.y=="number"||typeof s.x>"u"||typeof s.y>"u")}function W(s){return typeof s=="number"?{x:s,y:s}:{x:typeof s.x=="number"?s.x:0,y:typeof s.y=="number"?s.y:0}}function O(s,t,n,o,r=0){if(typeof r=="number")r=[r];else if(H(r))r=[r];else if(!Array.isArray(r))return;if(Array.isArray(r)){if(r.length===0||r.length>4)throw new RangeError(`Failed to execute 'roundRect' on '${this.constructor.name}': ${r.length} radii provided. Between one and four radii are necessary.`);r.forEach(z=>{if(H(z)){const k=z;if(typeof k.x=="number"&&k.x<0)throw new RangeError(`Failed to execute 'roundRect' on '${this.constructor.name}': Radius value ${k.x} is negative.`);if(typeof k.y=="number"&&k.y<0)throw new RangeError(`Failed to execute 'roundRect' on '${this.constructor.name}': Radius value ${k.y} is negative.`)}else{if(typeof z!="number")throw new TypeError(`Failed to execute 'roundRect' on '${this.constructor.name}': Radius value ${z} is not a number or DOMPointInit.`);if(typeof z=="number"&&z<0)throw new RangeError(`Failed to execute 'roundRect' on '${this.constructor.name}': Radius value ${z} is negative.`)}})}const a=r.map(W);if(r.length===1&&a[0].x===0&&a[0].y===0){this.rect(s,t,n,o);return}const l=n/2,f=o/2,c={x:Math.min(l,a[0].x),y:Math.min(f,a[0].y)};let u=c,p=c,m=c;a.length===2&&(u={x:Math.min(l,a[1].x),y:Math.min(f,a[1].y)},m=u),a.length===3&&(u={x:Math.min(l,a[1].x),y:Math.min(f,a[1].y)},m=u,p={x:Math.min(l,a[2].x),y:Math.min(f,a[2].y)}),a.length===4&&(u={x:Math.min(l,a[1].x),y:Math.min(f,a[1].y)},p={x:Math.min(l,a[2].x),y:Math.min(f,a[2].y)},m={x:Math.min(l,a[3].x),y:Math.min(f,a[3].y)}),this.moveTo(s,t+o-m.y),c.x===c.y&&c.x>0?this.arcTo(s,t,s+c.x,t,c.x):c.x>0||c.y>0?this.ellipse(s+c.x,t+c.y,c.x,c.y,0,Math.PI,Math.PI*1.5,!1):this.lineTo(s,t),this.lineTo(s+n-u.x,t),u.x===u.y&&u.x>0?this.arcTo(s+n,t,s+n,t+u.y,u.x):u.x>0||u.y>0?this.ellipse(s+n-u.x,t+u.y,u.x,u.y,0,Math.PI*1.5,0,!1):this.lineTo(s+n,t),this.lineTo(s+n,t+o-p.y),p.x===p.y&&p.x>0?this.arcTo(s+n,t+o,s+n-p.x,t+o,p.x):p.x>0||p.y>0?this.ellipse(s+n-p.x,t+o-p.y,p.x,p.y,0,0,Math.PI*.5,!1):this.lineTo(s+n,t+o),this.lineTo(s+m.x,t+o),m.x===m.y&&m.x>0?this.arcTo(s,t+o,s,t+o-m.y,m.x):m.x>0||m.y>0?this.ellipse(s+m.x,t+o-m.y,m.x,m.y,0,Math.PI*.5,Math.PI,!1):this.lineTo(s,t+o),this.closePath(),this.moveTo(s,t)}function D(s){if(!s)return;const t=s.prototype.clip,n=s.prototype.fill,o=s.prototype.stroke,r=s.prototype.isPointInPath;s.prototype.clip=function(...l){if(l[0]instanceof E){const c=l[0],u=l[1]!==void 0?l[1]:"nonzero";c.buildPathInCanvas(this),t.apply(this,[u]);return}const f=l[0]!==void 0?l[0]:"nonzero";t.apply(this,[f])},s.prototype.fill=function(...l){if(l[0]instanceof E){const c=l[0],u=l[1]!==void 0?l[1]:"nonzero";c.buildPathInCanvas(this),n.apply(this,[u]);return}const f=l[0]!==void 0?l[0]:"nonzero";n.apply(this,[f])},s.prototype.stroke=function(l){l&&l.buildPathInCanvas(this),o.apply(this)},s.prototype.isPointInPath=function(...l){if(l[0]instanceof E){const f=l[0],c=l[1],u=l[2],p=l[3]!==void 0?l[3]:"nonzero";return f.buildPathInCanvas(this),r.apply(this,[c,u,p])}return r.apply(this,l)}}function g(s){s&&!s.prototype.roundRect&&(s.prototype.roundRect=O)}function ee(s){s&&!s.prototype.roundRect&&(s.prototype.roundRect=O)}function te(){window&&(window.CanvasRenderingContext2D&&!window.Path2D&&(window.Path2D=E,D(window.CanvasRenderingContext2D)),ee(window.Path2D),g(window.CanvasRenderingContext2D))}te()})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "path2d-polyfill",
3
- "version": "3.1.2",
3
+ "version": "3.2.0",
4
4
  "description": "Polyfills Path2D api for canvas rendering",
5
5
  "keywords": [
6
6
  "Path2D",
@@ -32,24 +32,19 @@
32
32
  "last 2 versions",
33
33
  "not dead"
34
34
  ],
35
- "prettier": "@qlik/prettier-config",
36
35
  "dependencies": {
37
- "path2d": "^0.2.1"
36
+ "path2d": "^0.3.0"
38
37
  },
39
38
  "devDependencies": {
40
- "@babel/core": "^7.24.7",
41
- "@babel/preset-env": "^7.24.7",
42
- "@qlik/eslint-config": "^0.7.25",
43
- "@qlik/prettier-config": "^0.4.15",
44
- "@qlik/tsconfig": "^0.2.6",
39
+ "@babel/core": "^7.27.4",
40
+ "@babel/preset-env": "^7.27.2",
41
+ "@qlik/tsconfig": "^0.3.1",
45
42
  "@rollup/plugin-babel": "^6.0.4",
46
- "@vitest/coverage-v8": "^1.6.0",
47
- "eslint": "^8.57.0",
48
- "jsdom": "^24.1.0",
49
- "prettier": "^3.3.2",
50
- "typescript": "^5.5.2",
51
- "vite": "^5.3.2",
52
- "vitest": "^1.6.0"
43
+ "@vitest/coverage-v8": "^3.2.4",
44
+ "jsdom": "^26.1.0",
45
+ "typescript": "^5.8.3",
46
+ "vite": "^6.3.5",
47
+ "vitest": "^3.2.4"
53
48
  },
54
49
  "publishConfig": {
55
50
  "access": "public"
@@ -58,9 +53,9 @@
58
53
  "build": "vite build && cp dist/path2d-polyfill.min.js test/path2d-polyfill.min.js",
59
54
  "check-types": "tsc --noEmit",
60
55
  "dev": "vite",
61
- "format:check": "prettier --check '**' --ignore-unknown",
62
- "format:write": "prettier --write '**' --ignore-unknown",
63
- "lint": "eslint .",
56
+ "format:check": "cd ../.. && pnpm exec prettier --check 'packages/path2d-polyfill/**' --ignore-unknown",
57
+ "format:write": "cd ../.. && pnpm exec prettier --write 'packages/path2d-polyfill/**' --ignore-unknown",
58
+ "lint": "cd ../.. && pnpm exec eslint ./packages/path2d-polyfill",
64
59
  "preview": "vite preview",
65
60
  "test": "vitest run",
66
61
  "test:coverage": "vitest run --coverage",