svelte-multistyle-ui 0.0.2-alpha → 0.0.3-alpha
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.
|
@@ -47,13 +47,17 @@ Chart.register(
|
|
|
47
47
|
// Safety patch: ensure setLineDash always receives a valid array.
|
|
48
48
|
// Chart.js v4 can pass undefined/null internal values that throw "cannot be
|
|
49
49
|
// converted to a sequence" in some browser environments.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
// Guarded so the module stays safe during SSR (CanvasRenderingContext2D is
|
|
51
|
+
// only available in the browser).
|
|
52
|
+
if (typeof CanvasRenderingContext2D !== "undefined") {
|
|
53
|
+
const origSetLineDash = CanvasRenderingContext2D.prototype.setLineDash;
|
|
54
|
+
CanvasRenderingContext2D.prototype.setLineDash = function (segments) {
|
|
55
|
+
if (!segments || typeof segments !== "object" || typeof segments[Symbol.iterator] !== "function") {
|
|
56
|
+
return origSetLineDash.call(this, []);
|
|
57
|
+
}
|
|
58
|
+
return origSetLineDash.call(this, segments);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
57
61
|
|
|
58
62
|
/**
|
|
59
63
|
* Read theme tokens from a DOM element's computed style.
|
package/package.json
CHANGED