svg-path-commander 2.0.5 → 2.0.7

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.
Files changed (97) hide show
  1. package/.eslintrc.cjs +1 -1
  2. package/.lgtm.yml +0 -0
  3. package/.prettierrc.json +0 -0
  4. package/LICENSE +0 -0
  5. package/README.md +5 -5
  6. package/cypress/e2e/svg-path-commander.spec.ts +1 -1
  7. package/cypress/fixtures/shapeObjects.js +0 -0
  8. package/cypress/fixtures/shapes.js +7 -7
  9. package/cypress/fixtures/simpleShapes.js +0 -0
  10. package/cypress/plugins/esbuild-istanbul.ts +0 -0
  11. package/cypress/plugins/tsCompile.ts +0 -0
  12. package/cypress/support/commands.ts +0 -0
  13. package/cypress/support/e2e.ts +0 -0
  14. package/cypress/test.html +0 -0
  15. package/cypress.config.ts +0 -0
  16. package/dist/svg-path-commander.cjs +1 -1
  17. package/dist/svg-path-commander.cjs.map +1 -1
  18. package/dist/svg-path-commander.d.ts +8 -0
  19. package/dist/svg-path-commander.js +1 -1
  20. package/dist/svg-path-commander.js.map +1 -1
  21. package/dist/svg-path-commander.mjs +66 -63
  22. package/dist/svg-path-commander.mjs.map +1 -1
  23. package/dts.config.ts +0 -0
  24. package/package.json +13 -13
  25. package/src/convert/pathToAbsolute.ts +0 -0
  26. package/src/convert/pathToCurve.ts +0 -0
  27. package/src/convert/pathToRelative.ts +0 -0
  28. package/src/convert/pathToString.ts +0 -0
  29. package/src/index.ts +2 -0
  30. package/src/interface.ts +0 -0
  31. package/src/math/distanceSquareRoot.ts +0 -0
  32. package/src/math/midPoint.ts +0 -0
  33. package/src/math/polygonArea.ts +0 -0
  34. package/src/math/polygonLength.ts +0 -0
  35. package/src/math/rotateVector.ts +0 -0
  36. package/src/options/options.ts +0 -0
  37. package/src/parser/error.ts +0 -0
  38. package/src/parser/finalizeSegment.ts +0 -0
  39. package/src/parser/invalidPathValue.ts +0 -0
  40. package/src/parser/isArcCommand.ts +0 -0
  41. package/src/parser/isDigit.ts +0 -0
  42. package/src/parser/isDigitStart.ts +0 -0
  43. package/src/parser/isPathCommand.ts +0 -0
  44. package/src/parser/isSpace.ts +0 -0
  45. package/src/parser/paramsCount.ts +0 -0
  46. package/src/parser/paramsParser.ts +0 -0
  47. package/src/parser/parsePathString.ts +0 -0
  48. package/src/parser/pathParser.ts +0 -0
  49. package/src/parser/scanFlag.ts +0 -0
  50. package/src/parser/scanParam.ts +0 -0
  51. package/src/parser/scanSegment.ts +0 -0
  52. package/src/parser/skipSpaces.ts +0 -0
  53. package/src/process/arcToCubic.ts +0 -0
  54. package/src/process/fixArc.ts +0 -0
  55. package/src/process/getSVGMatrix.ts +0 -0
  56. package/src/process/lineToCubic.ts +3 -3
  57. package/src/process/normalizePath.ts +0 -0
  58. package/src/process/normalizeSegment.ts +0 -0
  59. package/src/process/optimizePath.ts +0 -0
  60. package/src/process/projection2d.ts +0 -0
  61. package/src/process/quadToCubic.ts +0 -0
  62. package/src/process/reverseCurve.ts +0 -0
  63. package/src/process/reversePath.ts +0 -0
  64. package/src/process/roundPath.ts +0 -0
  65. package/src/process/segmentToCubic.ts +0 -0
  66. package/src/process/shortenSegment.ts +0 -0
  67. package/src/process/splitCubic.ts +0 -0
  68. package/src/process/splitPath.ts +0 -0
  69. package/src/process/transformPath.ts +0 -0
  70. package/src/types.ts +0 -0
  71. package/src/util/getClosestPoint.ts +0 -0
  72. package/src/util/getDrawDirection.ts +0 -0
  73. package/src/util/getPathArea.ts +0 -0
  74. package/src/util/getPathBBox.ts +0 -0
  75. package/src/util/getPointAtLength.ts +0 -0
  76. package/src/util/getPropertiesAtLength.ts +0 -0
  77. package/src/util/getPropertiesAtPoint.ts +0 -0
  78. package/src/util/getSegmentAtLength.ts +0 -0
  79. package/src/util/getSegmentOfPoint.ts +0 -0
  80. package/src/util/getTotalLength.ts +0 -0
  81. package/src/util/isAbsoluteArray.ts +0 -0
  82. package/src/util/isCurveArray.ts +0 -0
  83. package/src/util/isNormalizedArray.ts +0 -0
  84. package/src/util/isPathArray.ts +0 -0
  85. package/src/util/isPointInStroke.ts +0 -0
  86. package/src/util/isRelativeArray.ts +0 -0
  87. package/src/util/isValidPath.ts +0 -0
  88. package/src/util/pathLengthFactory.ts +0 -0
  89. package/src/util/segmentArcFactory.ts +0 -0
  90. package/src/util/segmentCubicFactory.ts +0 -0
  91. package/src/util/segmentLineFactory.ts +0 -0
  92. package/src/util/segmentQuadFactory.ts +0 -0
  93. package/src/util/shapeParams.ts +0 -0
  94. package/src/util/shapeToPath.ts +0 -0
  95. package/src/util/shapeToPathArray.ts +0 -0
  96. package/tsconfig.json +0 -0
  97. package/vite.config.ts +0 -0
package/dts.config.ts CHANGED
File without changes
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "svg-path-commander",
3
3
  "author": "thednp",
4
4
  "license": "MIT",
5
- "version": "2.0.5",
5
+ "version": "2.0.7",
6
6
  "description": "Modern TypeScript tools for SVG",
7
7
  "source": "./src/index.ts",
8
8
  "main": "./dist/svg-path-commander.js",
@@ -53,26 +53,26 @@
53
53
  "homepage": "http://thednp.github.io/svg-path-commander",
54
54
  "devDependencies": {
55
55
  "@bahmutov/cypress-esbuild-preprocessor": "^2.2.0",
56
- "@cypress/code-coverage": "^3.10.0",
56
+ "@cypress/code-coverage": "^3.10.7",
57
57
  "@types/istanbul-lib-instrument": "^1.7.4",
58
- "@typescript-eslint/eslint-plugin": "^5.55.0",
59
- "@typescript-eslint/parser": "^5.55.0",
60
- "cypress": "^12.8.1",
61
- "dts-bundle-generator": "^7.2.0",
62
- "eslint": "^8.36.0",
63
- "eslint-plugin-jsdoc": "^40.0.3",
58
+ "@typescript-eslint/eslint-plugin": "^5.59.9",
59
+ "@typescript-eslint/parser": "^5.59.9",
60
+ "cypress": "^12.14.0",
61
+ "dts-bundle-generator": "^8.0.1",
62
+ "eslint": "^8.42.0",
63
+ "eslint-plugin-jsdoc": "^46.2.6",
64
64
  "eslint-plugin-prefer-arrow": "^1.2.3",
65
65
  "eslint-plugin-prettier": "^4.2.1",
66
66
  "istanbul-lib-coverage": "^3.2.0",
67
67
  "istanbul-lib-instrument": "^5.2.1",
68
68
  "ncp": "^2.0.0",
69
69
  "nyc": "^15.1.0",
70
- "prettier": "^2.8.4",
71
- "rimraf": "^4.4.0",
72
- "typescript": "^5.0.2",
73
- "vite": "^4.2.0"
70
+ "prettier": "^2.8.8",
71
+ "rimraf": "^5.0.1",
72
+ "typescript": "^5.1.3",
73
+ "vite": "^4.3.9"
74
74
  },
75
75
  "dependencies": {
76
- "@thednp/dommatrix": "^2.0.4"
76
+ "@thednp/dommatrix": "^2.0.5"
77
77
  }
78
78
  }
File without changes
File without changes
File without changes
File without changes
package/src/index.ts CHANGED
@@ -34,6 +34,7 @@ import shapeToPath from './util/shapeToPath';
34
34
 
35
35
  import roundPath from './process/roundPath';
36
36
  import splitPath from './process/splitPath';
37
+ import getSVGMatrix from './process/getSVGMatrix';
37
38
  import optimizePath from './process/optimizePath';
38
39
  import reverseCurve from './process/reverseCurve';
39
40
  import reversePath from './process/reversePath';
@@ -59,6 +60,7 @@ import pathToString from './convert/pathToString';
59
60
  class SVGPathCommander {
60
61
  // bring main utilities to front
61
62
  public static CSSMatrix = CSSMatrix;
63
+ public static getSVGMatrix = getSVGMatrix;
62
64
  public static getPathBBox = getPathBBox;
63
65
  public static getPathArea = getPathArea;
64
66
  public static getTotalLength = getTotalLength;
package/src/interface.ts CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -10,8 +10,8 @@ import midPoint from '../math/midPoint';
10
10
  * @returns the cubic-bezier segment
11
11
  */
12
12
  const lineToCubic = (x1: number, y1: number, x2: number, y2: number) => {
13
- const t = 0.5;
14
- const mid = midPoint([x1, y1], [x2, y2], t);
15
- return [...mid, x2, y2, x2, y2];
13
+ const c1 = midPoint([x1, y1], [x2, y2], 1.0 / 3.0);
14
+ const c2 = midPoint([x1, y1], [x2, y2], 2.0 / 3.0);
15
+ return [...c1, ...c2, x2, y2];
16
16
  };
17
17
  export default lineToCubic;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/types.ts CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/tsconfig.json CHANGED
File without changes
package/vite.config.ts CHANGED
File without changes