Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert three variable assignments to the usage of compound operators #131

Open
elfring opened this issue Dec 12, 2021 · 0 comments
Open

Comments

@elfring
Copy link

elfring commented Dec 12, 2021

馃憖 Some source code analysis tools can help to find opportunities for improving software components.
馃挱 I propose to increase the usage of compound operators accordingly.

diff --git a/dist/js/chocolat.cjs.js b/dist/js/chocolat.cjs.js
index a873b22..7958c66 100644
--- a/dist/js/chocolat.cjs.js
+++ b/dist/js/chocolat.cjs.js
@@ -23,7 +23,7 @@ function _classCallCheck(instance, Constructor) {
 function _defineProperties(target, props) {
   for (var i = 0; i < props.length; i++) {
     var descriptor = props[i];
-    descriptor.enumerable = descriptor.enumerable || false;
+    descriptor.enumerable ||= false;
     descriptor.configurable = true;
     if ("value" in descriptor) descriptor.writable = true;
     Object.defineProperty(target, descriptor.key, descriptor);
diff --git a/dist/js/chocolat.esm.js b/dist/js/chocolat.esm.js
index 997b43c..653887d 100644
--- a/dist/js/chocolat.esm.js
+++ b/dist/js/chocolat.esm.js
@@ -21,7 +21,7 @@ function _classCallCheck(instance, Constructor) {
 function _defineProperties(target, props) {
   for (var i = 0; i < props.length; i++) {
     var descriptor = props[i];
-    descriptor.enumerable = descriptor.enumerable || false;
+    descriptor.enumerable ||= false;
     descriptor.configurable = true;
     if ("value" in descriptor) descriptor.writable = true;
     Object.defineProperty(target, descriptor.key, descriptor);
diff --git a/dist/js/chocolat.js b/dist/js/chocolat.js
index 474490e..43847f1 100644
--- a/dist/js/chocolat.js
+++ b/dist/js/chocolat.js
@@ -759,7 +759,7 @@
 	function _defineProperties(target, props) {
 	  for (var i = 0; i < props.length; i++) {
 	    var descriptor = props[i];
-	    descriptor.enumerable = descriptor.enumerable || false;
+	    descriptor.enumerable ||= false;
 	    descriptor.configurable = true;
 	    if ("value" in descriptor) descriptor.writable = true;
 	    Object.defineProperty(target, descriptor.key, descriptor);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant