Repository: chartjs/chartjs-plugin-zoom
Pull request #626 (2022-03-02 13:32:20)

Bump karma from 6.3.14 to 6.3.16
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.14 to 6.3.16.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/karma-runner/karma/releases">karma's releases</a>.</em></p>
<blockquote>
<h2>v6.3.16</h2>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.15...v6.3.16">6.3.16</a> (2022-02-10)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>security:</strong> mitigate the &quot;Open Redirect Vulnerability&quot; (<a href="https://github.com/karma-runner/karma/commit/ff7edbb2ffbcdd69761bece86b7dc1ef0740508d">ff7edbb</a>)</li>
</ul>
<h2>v6.3.15</h2>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.14...v6.3.15">6.3.15</a> (2022-02-05)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>helper:</strong> make mkdirIfNotExists helper resilient to concurrent calls (<a href="https://github.com/karma-runner/karma/commit/d9dade2f004a340e49c9a633177576200c286404">d9dade2</a>), closes <a href="https://github-redirect.dependabot.com//github-redirect.dependabot.com/karma-runner/karma-coverage/issues/434/issues/issuecomment-1017939333">karma-runner/karma-coverage#434</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/karma-runner/karma/blob/master/CHANGELOG.md">karma's changelog</a>.</em></p>
<blockquote>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.15...v6.3.16">6.3.16</a> (2022-02-10)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>security:</strong> mitigate the &quot;Open Redirect Vulnerability&quot; (<a href="https://github.com/karma-runner/karma/commit/ff7edbb2ffbcdd69761bece86b7dc1ef0740508d">ff7edbb</a>)</li>
</ul>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.14...v6.3.15">6.3.15</a> (2022-02-05)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>helper:</strong> make mkdirIfNotExists helper resilient to concurrent calls (<a href="https://github.com/karma-runner/karma/commit/d9dade2f004a340e49c9a633177576200c286404">d9dade2</a>), closes <a href="https://github-redirect.dependabot.com//github-redirect.dependabot.com/karma-runner/karma-coverage/issues/434/issues/issuecomment-1017939333">karma-runner/karma-coverage#434</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/karma-runner/karma/commit/ab4b32898bcb4e0ba3a1e99835d30c113db3eeeb"><code>ab4b328</code></a> chore(release): 6.3.16 [skip ci]</li>
<li><a href="https://github.com/karma-runner/karma/commit/ff7edbb2ffbcdd69761bece86b7dc1ef0740508d"><code>ff7edbb</code></a> fix(security): mitigate the &quot;Open Redirect Vulnerability&quot;</li>
<li><a href="https://github.com/karma-runner/karma/commit/c1befa04b32b90f088fefdc0521c6f48cbc510a9"><code>c1befa0</code></a> chore(release): 6.3.15 [skip ci]</li>
<li><a href="https://github.com/karma-runner/karma/commit/d9dade2f004a340e49c9a633177576200c286404"><code>d9dade2</code></a> fix(helper): make mkdirIfNotExists helper resilient to concurrent calls</li>
<li><a href="https://github.com/karma-runner/karma/commit/653c762be4fa464fed5bfa306317b84cc5c28a17"><code>653c762</code></a> ci: prevent duplicate CI tasks on creating a PR</li>
<li>See full diff in <a href="https://github.com/karma-runner/karma/compare/v6.3.14...v6.3.16">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=karma&package-manager=npm_and_yarn&previous-version=6.3.14&new-version=6.3.16)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/chartjs/chartjs-plugin-zoom/network/alerts).

</details>


Patch:
diff --git a/package-lock.json b/package-lock.json
index 6b181b0..7973411 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10660,9 +10660,9 @@
       }
     },
     "node_modules/karma": {
-      "version": "6.3.14",
-      "resolved": "https://registry.npmjs.org/karma/-/karma-6.3.14.tgz",
-      "integrity": "sha512-SDFoU5F4LdosEiUVWUDRPCV/C1zQRNtIakx7rWkigf7R4sxGADlSEeOma4S1f/js7YAzvqLW92ByoiQptg+8oQ==",
+      "version": "6.3.16",
+      "resolved": "https://registry.npmjs.org/karma/-/karma-6.3.16.tgz",
+      "integrity": "sha512-nEU50jLvDe5yvXqkEJRf8IuvddUkOY2x5Xc4WXHz6dxINgGDrgD2uqQWeVrJs4hbfNaotn+HQ1LZJ4yOXrL7xQ==",
       "dev": true,
       "dependencies": {
         "body-parser": "^1.19.0",
@@ -10680,6 +10680,7 @@
         "log4js": "^6.4.1",
         "mime": "^2.5.2",
         "minimatch": "^3.0.4",
+        "mkdirp": "^0.5.5",
         "qjobs": "^1.2.0",
         "range-parser": "^1.2.1",
         "rimraf": "^3.0.2",
@@ -27159,9 +27160,9 @@
       }
     },
     "karma": {
-      "version": "6.3.14",
-      "resolved": "https://registry.npmjs.org/karma/-/karma-6.3.14.tgz",
-      "integrity": "sha512-SDFoU5F4LdosEiUVWUDRPCV/C1zQRNtIakx7rWkigf7R4sxGADlSEeOma4S1f/js7YAzvqLW92ByoiQptg+8oQ==",
+      "version": "6.3.16",
+      "resolved": "https://registry.npmjs.org/karma/-/karma-6.3.16.tgz",
+      "integrity": "sha512-nEU50jLvDe5yvXqkEJRf8IuvddUkOY2x5Xc4WXHz6dxINgGDrgD2uqQWeVrJs4hbfNaotn+HQ1LZJ4yOXrL7xQ==",
       "dev": true,
       "requires": {
         "body-parser": "^1.19.0",
@@ -27179,6 +27180,7 @@
         "log4js": "^6.4.1",
         "mime": "^2.5.2",
         "minimatch": "^3.0.4",
+        "mkdirp": "^0.5.5",
         "qjobs": "^1.2.0",
         "range-parser": "^1.2.1",
         "rimraf": "^3.0.2",
diff --git a/src/core.js b/src/core.js
index be259a4..79b4ad4 100644
--- a/src/core.js
+++ b/src/core.js
@@ -218,11 +218,11 @@ export function isZoomedOrPanned(chart) {
   for (const scaleId of Object.keys(chart.scales)) {
     const {min: originalMin, max: originalMax} = scaleBounds[scaleId];
 
-    if (chart.scales[scaleId].min !== originalMin) {
+    if (originalMin !== undefined && chart.scales[scaleId].min !== originalMin) {
       return true;
     }
 
-    if (chart.scales[scaleId].max !== originalMax) {
+    if (originalMax !== undefined && chart.scales[scaleId].max !== originalMax) {
       return true;
     }
   }


Test patch:
diff --git a/test/specs/api.spec.js b/test/specs/api.spec.js
index fd98bf6..46f1672 100644
--- a/test/specs/api.spec.js
+++ b/test/specs/api.spec.js
@@ -142,6 +142,8 @@ describe('api', function() {
         }
       });
 
+      expect(chart.isZoomedOrPanned()).toBe(false);
+
       chart.zoom(1);
       expect(chart.isZoomedOrPanned()).toBe(false);
 
@@ -172,6 +174,8 @@ describe('api', function() {
         }
       });
 
+      expect(chart.isZoomedOrPanned()).toBe(false);
+
       chart.pan({x: 0, y: 0});
       expect(chart.isZoomedOrPanned()).toBe(false);