@thi.ng/hiccup-canvas 3.1.30 → 3.1.32

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2025-01-04T21:07:38Z
3
+ - **Last updated**: 2025-01-14T12:23:33Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [3.1.31](https://github.com/thi-ng/umbrella/tree/@thi.ng/hiccup-canvas@3.1.31) (2025-01-14)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - use optional chaining & nullish coalescing ([c5a0a13](https://github.com/thi-ng/umbrella/commit/c5a0a13))
17
+
12
18
  ## [3.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/hiccup-canvas@3.1.0) (2024-06-21)
13
19
 
14
20
  #### 🚀 Features
package/README.md CHANGED
@@ -105,7 +105,7 @@ For Node.js REPL:
105
105
  const hc = await import("@thi.ng/hiccup-canvas");
106
106
  ```
107
107
 
108
- Package sizes (brotli'd, pre-treeshake): ESM: 2.57 KB
108
+ Package sizes (brotli'd, pre-treeshake): ESM: 2.58 KB
109
109
 
110
110
  ## Dependencies
111
111
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/hiccup-canvas",
3
- "version": "3.1.30",
3
+ "version": "3.1.32",
4
4
  "description": "Hiccup shape tree renderer for vanilla Canvas 2D contexts",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -41,12 +41,12 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@thi.ng/api": "^8.11.16",
44
- "@thi.ng/checks": "^3.6.18",
45
- "@thi.ng/color": "^5.7.16",
46
- "@thi.ng/geom-arc": "^2.1.158",
44
+ "@thi.ng/checks": "^3.6.19",
45
+ "@thi.ng/color": "^5.7.18",
46
+ "@thi.ng/geom-arc": "^2.1.160",
47
47
  "@thi.ng/math": "^5.11.16",
48
- "@thi.ng/pixel": "^7.3.11",
49
- "@thi.ng/vectors": "^7.12.13"
48
+ "@thi.ng/pixel": "^7.3.12",
49
+ "@thi.ng/vectors": "^7.12.15"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@microsoft/api-extractor": "^7.48.1",
@@ -138,5 +138,5 @@
138
138
  ],
139
139
  "year": 2018
140
140
  },
141
- "gitHead": "56c1d57a96565bbcc8c06c73779a619bba0db368\n"
141
+ "gitHead": "d888087b36b086fd8c3e7dc98d35857266f78942\n"
142
142
  }
package/points.js CHANGED
@@ -9,7 +9,7 @@ const points = (ctx, attribs, opts, pts) => {
9
9
  }
10
10
  };
11
11
  const __drawPoints = (ctx, opts, pts, cmd, cmdR) => {
12
- const s = opts && opts.size || 1;
12
+ const s = opts?.size || 1;
13
13
  if (opts.shape === "circle") {
14
14
  for (let p of pts) {
15
15
  ctx.beginPath();
package/polygon.js CHANGED
@@ -22,7 +22,7 @@ const __drawPoly = (ctx, pts) => {
22
22
  };
23
23
  const __drawPackedPoly = (ctx, opts, pts) => {
24
24
  const { start = 0, cstride = 1, estride = 2 } = opts;
25
- let num = opts && opts.num != null ? opts.num : (pts.length - start) / estride | 0;
25
+ let num = opts?.num ?? (pts.length - start) / estride | 0;
26
26
  ctx.beginPath();
27
27
  ctx.moveTo(pts[start], pts[start + cstride]);
28
28
  for (let i = start + estride; num-- > 1; i += estride) {