]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
refactor: set map condition branch (#2710)
authorSimon He <57086651+Simon-He95@users.noreply.github.com>
Tue, 9 Jul 2024 07:48:34 +0000 (15:48 +0800)
committerGitHub <noreply@github.com>
Tue, 9 Jul 2024 07:48:34 +0000 (09:48 +0200)
packages/pinia/src/store.ts

index afe5b2024c303176fe3a8bc8da1681b71b23ff84..2ff355b8d2143244996bc2fed9decdda8b7a5435 100644 (file)
@@ -62,9 +62,8 @@ function mergeReactiveObjects<
   // Handle Map instances
   if (target instanceof Map && patchToApply instanceof Map) {
     patchToApply.forEach((value, key) => target.set(key, value))
-  }
-  // Handle Set instances
-  if (target instanceof Set && patchToApply instanceof Set) {
+  } else if (target instanceof Set && patchToApply instanceof Set) {
+    // Handle Set instances
     patchToApply.forEach(target.add, target)
   }