Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch @napi-rs/canvas@0.1.54 for the project I'm working on.
The package compatibility is declared as "node": ">= 10" in package.json, but ?? is used in geometry.js. However, this operator is only supported in node 14 and above.
Here is the diff that solved my problem:
diff --git a/node_modules/@napi-rs/canvas/geometry.js b/node_modules/@napi-rs/canvas/geometry.js
index fb6b8a5..656da04 100644
--- a/node_modules/@napi-rs/canvas/geometry.js
+++ b/node_modules/@napi-rs/canvas/geometry.js
@@ -771,10 +771,10 @@ class DOMMatrix {
}
transformPoint(point) {
- const x = point.x ?? 0
- const y = point.y ?? 0
- const z = point.z ?? 0
- const w = point.w ?? 1
+ const x = point.x || 0
+ const y = point.y || 0
+ const z = point.z || 0
+ const w = point.w || 1
const values = this[VALUES]
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
@napi-rs/canvas@0.1.54
for the project I'm working on.The package compatibility is declared as
"node": ">= 10"
inpackage.json
, but??
is used ingeometry.js
. However, this operator is only supported in node 14 and above.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.