@ejfdelgado/ejflab-common 1.16.2 → 1.16.4

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ejfdelgado/ejflab-common",
3
3
  "type": "commonjs",
4
- "version": "1.16.2",
4
+ "version": "1.16.4",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ejfdelgado/ejflab-common.git"
package/src/MyCookies.js CHANGED
@@ -7,7 +7,7 @@ class MyCookies {
7
7
  document.cookie = cname + '=' + cvalue + ';' + expires + ';path=/';
8
8
  }
9
9
 
10
- static getCookie(cname) {
10
+ static getCookie(cname, def = null) {
11
11
  let name = cname + '=';
12
12
  let decodedCookie = decodeURIComponent(document.cookie);
13
13
  let ca = decodedCookie.split(';');
@@ -20,7 +20,7 @@ class MyCookies {
20
20
  return c.substring(name.length, c.length);
21
21
  }
22
22
  }
23
- return null;
23
+ return def;
24
24
  }
25
25
 
26
26
  static deleteCookie(cname) {
package/src/MyThrottle.js CHANGED
@@ -37,8 +37,6 @@ class MyThrottle {
37
37
  if (calledTime == this.lastCalledTime) {
38
38
  // Listen again
39
39
  this.isIgnoring = false;
40
- } else {
41
- console.log("Ignoring...");
42
40
  }
43
41
  } else {
44
42
  this.isIgnoring = false;
@@ -51,7 +49,6 @@ class MyThrottle {
51
49
  }
52
50
  if (this.isCalling || this.isIgnoring) {
53
51
  // Ignore
54
- console.log("Ignoring...");
55
52
  return;
56
53
  }
57
54
  const afterCall = () => {
@@ -70,8 +67,6 @@ class MyThrottle {
70
67
  // Call!
71
68
  this.isCalling = true;
72
69
  promisedFunction(...args).finally(afterCall);
73
- } else {
74
- console.log("Ignoring...");
75
70
  }
76
71
  }, this.timeGap);
77
72
  }