path2d-polyfill 3.1.3 → 3.2.1

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";const q={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},H=/([astvzqmhlc])([^astvzqmhlc]*)/gi,V=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function Z(o){const l=o.match(V);return l?l.map(Number):[]}function U(o){const l=[],t=String(o).trim();return t[0]!=="M"&&t[0]!=="m"||t.replace(H,(n,s,a)=>{const r=Z(a);let u=s.toLowerCase(),c=s;if(u==="m"&&r.length>2&&(l.push([c,...r.splice(0,2)]),u="l",c=c==="m"?"l":"L"),r.length<q[u])return"";for(l.push([c,...r.splice(0,q[u])]);r.length>=q[u]&&r.length&&q[u];)l.push([c,...r.splice(0,q[u])]);return""}),l}function N(o,l){const t=o.x*Math.cos(l)-o.y*Math.sin(l),n=o.y*Math.cos(l)+o.x*Math.sin(l);o.x=t,o.y=n}function _(o,l,t){o.x+=l,o.y+=t}function S(o,l){o.x*=l,o.y*=l}class v{constructor(l){this.commands=[],l&&l instanceof v?this.commands.push(...l.commands):l&&(this.commands=U(l))}addPath(l){l&&l instanceof v&&this.commands.push(...l.commands)}moveTo(l,t){this.commands.push(["M",l,t])}lineTo(l,t){this.commands.push(["L",l,t])}arc(l,t,n,s,a,r){this.commands.push(["AC",l,t,n,s,a,!!r])}arcTo(l,t,n,s,a){this.commands.push(["AT",l,t,n,s,a])}ellipse(l,t,n,s,a,r,u,c){this.commands.push(["E",l,t,n,s,a,r,u,!!c])}closePath(){this.commands.push(["Z"])}bezierCurveTo(l,t,n,s,a,r){this.commands.push(["C",l,t,n,s,a,r])}quadraticCurveTo(l,t,n,s){this.commands.push(["Q",l,t,n,s])}rect(l,t,n,s){this.commands.push(["R",l,t,n,s])}roundRect(l,t,n,s,a){typeof a>"u"?this.commands.push(["RR",l,t,n,s,0]):this.commands.push(["RR",l,t,n,s,a])}}function A(o,l){let t=0,n=0,s,a,r,u,c,i,R,d,L,z,G,Q,E,p,f,C,I,b,k,F,B,m=null,P=null,y=null,T=null,w=null,M=null;o.beginPath();for(let h=0;h<l.length;++h){b=l[h][0],b!=="S"&&b!=="s"&&b!=="C"&&b!=="c"&&(m=null,P=null),b!=="T"&&b!=="t"&&b!=="Q"&&b!=="q"&&(y=null,T=null);let e;switch(b){case"m":case"M":e=l[h],b==="m"?(t+=e[1],n+=e[2]):(t=e[1],n=e[2]),(b==="M"||!w)&&(w={x:t,y:n}),o.moveTo(t,n);break;case"l":e=l[h],t+=e[1],n+=e[2],o.lineTo(t,n);break;case"L":e=l[h],t=e[1],n=e[2],o.lineTo(t,n);break;case"H":e=l[h],t=e[1],o.lineTo(t,n);break;case"h":e=l[h],t+=e[1],o.lineTo(t,n);break;case"V":e=l[h],n=e[1],o.lineTo(t,n);break;case"v":e=l[h],n+=e[1],o.lineTo(t,n);break;case"a":case"A":if(e=l[h],M===null)throw new Error("This should never happen");b==="a"?(t+=e[6],n+=e[7]):(t=e[6],n=e[7]),p=e[1],f=e[2],R=e[3]*Math.PI/180,r=!!e[4],u=!!e[5],c={x:t,y:n},i={x:(M.x-c.x)/2,y:(M.y-c.y)/2},N(i,-R),d=i.x*i.x/(p*p)+i.y*i.y/(f*f),d>1&&(d=Math.sqrt(d),p*=d,f*=d),k={x:p*i.y/f,y:-(f*i.x)/p},L=p*p*f*f,z=p*p*i.y*i.y+f*f*i.x*i.x,u!==r?S(k,Math.sqrt((L-z)/z)||0):S(k,-Math.sqrt((L-z)/z)||0),a=Math.atan2((i.y-k.y)/f,(i.x-k.x)/p),s=Math.atan2(-(i.y+k.y)/f,-(i.x+k.x)/p),N(k,R),_(k,(c.x+M.x)/2,(c.y+M.y)/2),o.save(),o.translate(k.x,k.y),o.rotate(R),o.scale(p,f),o.arc(0,0,1,a,s,!u),o.restore();break;case"C":e=l[h],m=e[3],P=e[4],t=e[5],n=e[6],o.bezierCurveTo(e[1],e[2],m,P,t,n);break;case"c":e=l[h],o.bezierCurveTo(e[1]+t,e[2]+n,e[3]+t,e[4]+n,e[5]+t,e[6]+n),m=e[3]+t,P=e[4]+n,t+=e[5],n+=e[6];break;case"S":e=l[h],(m===null||P===null)&&(m=t,P=n),o.bezierCurveTo(2*t-m,2*n-P,e[1],e[2],e[3],e[4]),m=e[1],P=e[2],t=e[3],n=e[4];break;case"s":e=l[h],(m===null||P===null)&&(m=t,P=n),o.bezierCurveTo(2*t-m,2*n-P,e[1]+t,e[2]+n,e[3]+t,e[4]+n),m=e[1]+t,P=e[2]+n,t+=e[3],n+=e[4];break;case"Q":e=l[h],y=e[1],T=e[2],t=e[3],n=e[4],o.quadraticCurveTo(y,T,t,n);break;case"q":e=l[h],y=e[1]+t,T=e[2]+n,t+=e[3],n+=e[4],o.quadraticCurveTo(y,T,t,n);break;case"T":e=l[h],(y===null||T===null)&&(y=t,T=n),y=2*t-y,T=2*n-T,t=e[1],n=e[2],o.quadraticCurveTo(y,T,t,n);break;case"t":e=l[h],(y===null||T===null)&&(y=t,T=n),y=2*t-y,T=2*n-T,t+=e[1],n+=e[2],o.quadraticCurveTo(y,T,t,n);break;case"z":case"Z":w&&(t=w.x,n=w.y),w=null,o.closePath();break;case"AC":e=l[h],t=e[1],n=e[2],E=e[3],a=e[4],s=e[5],F=e[6],o.arc(t,n,E,a,s,F);break;case"AT":e=l[h],G=e[1],Q=e[2],t=e[3],n=e[4],E=e[5],o.arcTo(G,Q,t,n,E);break;case"E":e=l[h],t=e[1],n=e[2],p=e[3],f=e[4],R=e[5],a=e[6],s=e[7],F=e[8],o.save(),o.translate(t,n),o.rotate(R),o.scale(p,f),o.arc(0,0,1,a,s,F),o.restore();break;case"R":e=l[h],t=e[1],n=e[2],C=e[3],I=e[4],w={x:t,y:n},o.rect(t,n,C,I);break;case"RR":e=l[h],t=e[1],n=e[2],C=e[3],I=e[4],B=e[5],w={x:t,y:n},o.roundRect(t,n,C,I,B);break;default:throw new Error(`Invalid path command: ${b}`)}M?(M.x=t,M.y=n):M={x:t,y:n}}}function $(o,l,t,n,s=0){if(typeof s=="number"&&(s=[s]),Array.isArray(s)){if(s.length===0||s.length>4)throw new RangeError(`Failed to execute 'roundRect' on '${this.constructor.name}': ${s.length} radii provided. Between one and four radii are necessary.`);s.forEach(R=>{if(R<0)throw new RangeError(`Failed to execute 'roundRect' on '${this.constructor.name}': Radius value ${R} is negative.`)})}else return;if(s.length===1&&s[0]===0){this.rect(o,l,t,n);return}const a=Math.min(t,n)/2,r=Math.min(a,s[0]);let u=r,c=r,i=r;s.length===2&&(u=Math.min(a,s[1]),i=u),s.length===3&&(u=Math.min(a,s[1]),i=u,c=Math.min(a,s[2])),s.length===4&&(u=Math.min(a,s[1]),c=Math.min(a,s[2]),i=Math.min(a,s[3])),this.moveTo(o,l+n-i),this.arcTo(o,l,o+r,l,r),this.arcTo(o+t,l,o+t,l+u,u),this.arcTo(o+t,l+n,o+t-c,l+n,c),this.arcTo(o,l+n,o,l+n-i,i),this.closePath()}function g(o){if(!o)return;const l=o.prototype.clip,t=o.prototype.fill,n=o.prototype.stroke,s=o.prototype.isPointInPath;o.prototype.clip=function(...r){if(r[0]instanceof v){const c=r[0],i=r[1]||"nonzero";return A(this,c.commands),l.apply(this,[i])}const u=r[0]||"nonzero";return l.apply(this,[u])},o.prototype.fill=function(...r){if(r[0]instanceof v){const c=r[0],i=r[1]||"nonzero";return A(this,c.commands),t.apply(this,[i])}const u=r[0]||"nonzero";return t.apply(this,[u])},o.prototype.stroke=function(r){r&&A(this,r.commands),n.apply(this)},o.prototype.isPointInPath=function(...r){if(r[0]instanceof v){const u=r[0],c=r[1],i=r[2],R=r[3]||"nonzero";return A(this,u.commands),s.apply(this,[c,i,R])}return s.apply(this,r)}}function j(o){o&&!o.prototype.roundRect&&(o.prototype.roundRect=$)}function J(o){o&&!o.prototype.roundRect&&(o.prototype.roundRect=$)}function K(){window&&(window.CanvasRenderingContext2D&&!window.Path2D&&(window.Path2D=v,g(window.CanvasRenderingContext2D)),J(window.Path2D),j(window.CanvasRenderingContext2D))}K()})();
1
+ (function(){"use strict";const z={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},j=/([astvzqmhlc])([^astvzqmhlc]*)/gi,B=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function H(s){const t=s.match(B);return t?t.map(Number):[]}function O(s){const t=[],n=String(s).trim();return n[0]!=="M"&&n[0]!=="m"||n.replace(j,(o,a,i)=>{const l=H(i);let h=a.toLowerCase(),u=a;if(h==="m"&&l.length>2&&(t.push([u,...l.splice(0,2)]),h="l",u=u==="m"?"l":"L"),l.length<z[h])return"";for(t.push([u,...l.splice(0,z[h])]);l.length>=z[h]&&l.length&&z[h];)t.push([u,...l.splice(0,z[h])]);return""}),t}function $(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 V(s,t,n){s.x+=t,s.y+=n}function F(s,t){s.x*=t,s.y*=t}class I{#e;constructor(t){this.#e=[],t&&t instanceof I?this.#e.push(...t.#e):t&&(this.#e=O(t))}addCustomCommand(t){this.#e.push(t)}addPath(t){t&&t instanceof I&&this.#e.push(...t.#e)}moveTo(t,n){this.#e.push(["M",t,n])}lineTo(t,n){this.#e.push(["L",t,n])}arc(t,n,o,a,i,l){this.#e.push(["AC",t,n,o,a,i,!!l])}arcTo(t,n,o,a,i){this.#e.push(["AT",t,n,o,a,i])}ellipse(t,n,o,a,i,l,h,u){this.#e.push(["E",t,n,o,a,i,l,h,!!u])}closePath(){this.#e.push(["Z"])}bezierCurveTo(t,n,o,a,i,l){this.#e.push(["C",t,n,o,a,i,l])}quadraticCurveTo(t,n,o,a){this.#e.push(["Q",t,n,o,a])}rect(t,n,o,a){this.#e.push(["R",t,n,o,a])}roundRect(t,n,o,a,i){typeof i>"u"?this.#e.push(["RR",t,n,o,a,0]):this.#e.push(["RR",t,n,o,a,i])}buildPathInCanvas(t){let n=0,o=0,a,i,l,h,u,r,f,y,x,P,S,G,q,p,m,A,C,d,v,E,Q,R=null,M=null,b=null,T=null,w=null,k=null;t.beginPath();for(let c=0;c<this.#e.length;++c){d=this.#e[c][0],d!=="S"&&d!=="s"&&d!=="C"&&d!=="c"&&(R=null,M=null),d!=="T"&&d!=="t"&&d!=="Q"&&d!=="q"&&(b=null,T=null);let e;switch(d){case"m":case"M":e=this.#e[c],d==="m"?(n+=e[1],o+=e[2]):(n=e[1],o=e[2]),(d==="M"||!w)&&(w={x:n,y:o}),t.moveTo(n,o);break;case"l":e=this.#e[c],n+=e[1],o+=e[2],t.lineTo(n,o);break;case"L":e=this.#e[c],n=e[1],o=e[2],t.lineTo(n,o);break;case"H":e=this.#e[c],n=e[1],t.lineTo(n,o);break;case"h":e=this.#e[c],n+=e[1],t.lineTo(n,o);break;case"V":e=this.#e[c],o=e[1],t.lineTo(n,o);break;case"v":e=this.#e[c],o+=e[1],t.lineTo(n,o);break;case"a":case"A":if(e=this.#e[c],k===null)throw new Error("This should never happen");d==="a"?(n+=e[6],o+=e[7]):(n=e[6],o=e[7]),p=e[1],m=e[2],f=e[3]*Math.PI/180,l=!!e[4],h=!!e[5],u={x:n,y:o},r={x:(k.x-u.x)/2,y:(k.y-u.y)/2},$(r,-f),y=r.x*r.x/(p*p)+r.y*r.y/(m*m),y>1&&(y=Math.sqrt(y),p*=y,m*=y),v={x:p*r.y/m,y:-(m*r.x)/p},x=p*p*m*m,P=p*p*r.y*r.y+m*m*r.x*r.x,h!==l?F(v,Math.sqrt((x-P)/P)||0):F(v,-Math.sqrt((x-P)/P)||0),i=Math.atan2((r.y-v.y)/m,(r.x-v.x)/p),a=Math.atan2(-(r.y+v.y)/m,-(r.x+v.x)/p),$(v,f),V(v,(u.x+k.x)/2,(u.y+k.y)/2),t.save(),t.translate(v.x,v.y),t.rotate(f),t.scale(p,m),t.arc(0,0,1,i,a,!h),t.restore();break;case"C":e=this.#e[c],R=e[3],M=e[4],n=e[5],o=e[6],t.bezierCurveTo(e[1],e[2],R,M,n,o);break;case"c":e=this.#e[c],t.bezierCurveTo(e[1]+n,e[2]+o,e[3]+n,e[4]+o,e[5]+n,e[6]+o),R=e[3]+n,M=e[4]+o,n+=e[5],o+=e[6];break;case"S":e=this.#e[c],(R===null||M===null)&&(R=n,M=o),t.bezierCurveTo(2*n-R,2*o-M,e[1],e[2],e[3],e[4]),R=e[1],M=e[2],n=e[3],o=e[4];break;case"s":e=this.#e[c],(R===null||M===null)&&(R=n,M=o),t.bezierCurveTo(2*n-R,2*o-M,e[1]+n,e[2]+o,e[3]+n,e[4]+o),R=e[1]+n,M=e[2]+o,n+=e[3],o+=e[4];break;case"Q":e=this.#e[c],b=e[1],T=e[2],n=e[3],o=e[4],t.quadraticCurveTo(b,T,n,o);break;case"q":e=this.#e[c],b=e[1]+n,T=e[2]+o,n+=e[3],o+=e[4],t.quadraticCurveTo(b,T,n,o);break;case"T":e=this.#e[c],(b===null||T===null)&&(b=n,T=o),b=2*n-b,T=2*o-T,n=e[1],o=e[2],t.quadraticCurveTo(b,T,n,o);break;case"t":e=this.#e[c],(b===null||T===null)&&(b=n,T=o),b=2*n-b,T=2*o-T,n+=e[1],o+=e[2],t.quadraticCurveTo(b,T,n,o);break;case"z":case"Z":w&&(n=w.x,o=w.y),w=null,t.closePath();break;case"AC":e=this.#e[c],n=e[1],o=e[2],q=e[3],i=e[4],a=e[5],E=e[6],t.arc(n,o,q,i,a,E);break;case"AT":e=this.#e[c],S=e[1],G=e[2],n=e[3],o=e[4],q=e[5],t.arcTo(S,G,n,o,q);break;case"E":e=this.#e[c],n=e[1],o=e[2],p=e[3],m=e[4],f=e[5],i=e[6],a=e[7],E=e[8],t.save(),t.translate(n,o),t.rotate(f),t.scale(p,m),t.arc(0,0,1,i,a,E),t.restore();break;case"R":e=this.#e[c],n=e[1],o=e[2],A=e[3],C=e[4],w={x:n,y:o},t.rect(n,o,A,C);break;case"RR":e=this.#e[c],n=e[1],o=e[2],A=e[3],C=e[4],Q=e[5],w={x:n,y:o},t.roundRect(n,o,A,C,Q);break;default:throw new Error(`Invalid path command: ${d}`)}k?(k.x=n,k.y=o):k={x:n,y:o}}}}function L(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 Z(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 N(s,t,n,o,a=0){if(typeof a=="number")a=[a];else if(L(a))a=[a];else if(!Array.isArray(a))return;if(Array.isArray(a)){if(a.length===0||a.length>4)throw new RangeError(`Failed to execute 'roundRect' on '${this.constructor.name}': ${a.length} radii provided. Between one and four radii are necessary.`);a.forEach(x=>{if(L(x)){const P=x;if(typeof P.x=="number"&&P.x<0)throw new RangeError(`Failed to execute 'roundRect' on '${this.constructor.name}': Radius value ${P.x} is negative.`);if(typeof P.y=="number"&&P.y<0)throw new RangeError(`Failed to execute 'roundRect' on '${this.constructor.name}': Radius value ${P.y} is negative.`)}else{if(typeof x!="number")throw new TypeError(`Failed to execute 'roundRect' on '${this.constructor.name}': Radius value ${x} is not a number or DOMPointInit.`);if(typeof x=="number"&&x<0)throw new RangeError(`Failed to execute 'roundRect' on '${this.constructor.name}': Radius value ${x} is negative.`)}})}const i=a.map(Z);if(a.length===1&&i[0].x===0&&i[0].y===0){this.rect(s,t,n,o);return}const l=n/2,h=o/2,u={x:Math.min(l,i[0].x),y:Math.min(h,i[0].y)};let r=u,f=u,y=u;i.length===2&&(r={x:Math.min(l,i[1].x),y:Math.min(h,i[1].y)},y=r),i.length===3&&(r={x:Math.min(l,i[1].x),y:Math.min(h,i[1].y)},y=r,f={x:Math.min(l,i[2].x),y:Math.min(h,i[2].y)}),i.length===4&&(r={x:Math.min(l,i[1].x),y:Math.min(h,i[1].y)},f={x:Math.min(l,i[2].x),y:Math.min(h,i[2].y)},y={x:Math.min(l,i[3].x),y:Math.min(h,i[3].y)}),this.moveTo(s,t+o-y.y),u.x===u.y&&u.x>0?this.arcTo(s,t,s+u.x,t,u.x):u.x>0||u.y>0?this.ellipse(s+u.x,t+u.y,u.x,u.y,0,Math.PI,Math.PI*1.5,!1):this.lineTo(s,t),this.lineTo(s+n-r.x,t),r.x===r.y&&r.x>0?this.arcTo(s+n,t,s+n,t+r.y,r.x):r.x>0||r.y>0?this.ellipse(s+n-r.x,t+r.y,r.x,r.y,0,Math.PI*1.5,0,!1):this.lineTo(s+n,t),this.lineTo(s+n,t+o-f.y),f.x===f.y&&f.x>0?this.arcTo(s+n,t+o,s+n-f.x,t+o,f.x):f.x>0||f.y>0?this.ellipse(s+n-f.x,t+o-f.y,f.x,f.y,0,0,Math.PI*.5,!1):this.lineTo(s+n,t+o),this.lineTo(s+y.x,t+o),y.x===y.y&&y.x>0?this.arcTo(s,t+o,s,t+o-y.y,y.x):y.x>0||y.y>0?this.ellipse(s+y.x,t+o-y.y,y.x,y.y,0,Math.PI*.5,Math.PI,!1):this.lineTo(s,t+o),this.closePath(),this.moveTo(s,t)}function U(s){if(!s)return;const t=s.prototype.clip,n=s.prototype.fill,o=s.prototype.stroke,a=s.prototype.isPointInPath;s.prototype.clip=function(...l){if(l[0]instanceof I){const u=l[0],r=l[1]!==void 0?l[1]:"nonzero";u.buildPathInCanvas(this),t.apply(this,[r]);return}const h=l[0]!==void 0?l[0]:"nonzero";t.apply(this,[h])},s.prototype.fill=function(...l){if(l[0]instanceof I){const u=l[0],r=l[1]!==void 0?l[1]:"nonzero";u.buildPathInCanvas(this),n.apply(this,[r]);return}const h=l[0]!==void 0?l[0]:"nonzero";n.apply(this,[h])},s.prototype.stroke=function(l){l&&l.buildPathInCanvas(this),o.apply(this)},s.prototype.isPointInPath=function(...l){if(l[0]instanceof I){const h=l[0],u=l[1],r=l[2],f=l[3]!==void 0?l[3]:"nonzero";return h.buildPathInCanvas(this),a.apply(this,[u,r,f])}return a.apply(this,l)}}function X(s){s&&!s.prototype.roundRect&&(s.prototype.roundRect=N)}function Y(s){s&&!s.prototype.roundRect&&(s.prototype.roundRect=N)}function _(){window&&(window.CanvasRenderingContext2D&&!window.Path2D&&(window.Path2D=I,U(window.CanvasRenderingContext2D)),Y(window.Path2D),X(window.CanvasRenderingContext2D))}_()})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "path2d-polyfill",
3
- "version": "3.1.3",
3
+ "version": "3.2.1",
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.2"
36
+ "path2d": "^0.3.1"
38
37
  },
39
38
  "devDependencies": {
40
- "@babel/core": "^7.26.0",
41
- "@babel/preset-env": "^7.26.0",
42
- "@qlik/eslint-config": "^0.8.1",
43
- "@qlik/prettier-config": "^0.4.18",
44
- "@qlik/tsconfig": "^0.2.7",
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": "^2.1.4",
47
- "eslint": "^8.57.1",
48
- "jsdom": "^25.0.1",
49
- "prettier": "^3.3.3",
50
- "typescript": "^5.6.3",
51
- "vite": "^5.4.10",
52
- "vitest": "^2.1.4"
43
+ "@vitest/coverage-v8": "^3.2.4",
44
+ "jsdom": "^26.1.0",
45
+ "typescript": "^5.8.3",
46
+ "vite": "^7.0.0",
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",