Skip to content

Commit b130acc

Browse files
committed
Changes:
* Added dispose instance method * Updated the reverse method to not return an absolute array * Version bump
1 parent 1820546 commit b130acc

13 files changed

+75
-40
lines changed

dist/svg-path-commander.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/svg-path-commander.cjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/svg-path-commander.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,13 @@ declare class SVGPathCommander {
820820
* @return the path string
821821
*/
822822
toString(): string;
823+
/**
824+
* Remove the instance.
825+
*
826+
* @public
827+
* @return void
828+
*/
829+
dispose(): void;
823830
}
824831

825832
declare namespace arcTools {

dist/svg-path-commander.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/svg-path-commander.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/svg-path-commander.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,6 @@ class A {
16661666
* @public
16671667
*/
16681668
reverse(t) {
1669-
this.toAbsolute();
16701669
const { segments: s } = this, r = Yt(s), n = r.length > 1 ? r : !1, i = n ? n.map((l, c) => t ? c ? ft(l) : l.slice(0) : ft(l)) : s.slice(0);
16711670
let o = [];
16721671
return n ? o = i.flat(1) : o = t ? s : ft(s), this.segments = o.slice(0), this;
@@ -1747,6 +1746,15 @@ class A {
17471746
toString() {
17481747
return kt(this.segments, this.round);
17491748
}
1749+
/**
1750+
* Remove the instance.
1751+
*
1752+
* @public
1753+
* @return void
1754+
*/
1755+
dispose() {
1756+
Object.keys(this).forEach((t) => delete this[t]);
1757+
}
17501758
}
17511759
d(A, "CSSMatrix", T), d(A, "pathToAbsolute", ht), d(A, "pathToRelative", Kt), d(A, "pathToCurve", yt), d(A, "pathToString", kt), d(A, "arcTools", Be), d(A, "bezierTools", {
17521760
Cvalues: Ae,

dist/svg-path-commander.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/svg-path-commander.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/svg-path-commander.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "svg-path-commander",
33
"author": "thednp",
44
"license": "MIT",
5-
"version": "2.1.3",
5+
"version": "2.1.4",
66
"description": "Modern TypeScript tools for SVG",
77
"source": "./src/index.ts",
88
"main": "./dist/svg-path-commander.js",

0 commit comments

Comments
 (0)