unetjs 2.0.5 → 2.0.8

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/dist/cjs/unet.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /* unet.js v2.0.5 2022-06-15T07:40:54.241Z */
1
+ /* unet.js v2.0.8 2022-07-21T08:08:24.416Z */
2
2
 
3
3
  'use strict';
4
4
 
@@ -22,7 +22,7 @@ function _interopNamespace(e) {
22
22
  return Object.freeze(n);
23
23
  }
24
24
 
25
- /* fjage.js v1.10.1 */
25
+ /* fjage.js v1.10.2 */
26
26
 
27
27
  const isBrowser =
28
28
  typeof window !== "undefined" && typeof window.document !== "undefined";
@@ -688,7 +688,7 @@ class Gateway {
688
688
  this.eventListeners = {}; // external listeners wanting to listen internal events
689
689
  this.queue = []; // incoming message queue
690
690
  this.debug = false; // debug info to be logged to console?
691
- this.aid = new AgentID(isBrowser ? 'WebGW-' : 'NodeGW-'+_guid(4)); // gateway agent name
691
+ this.aid = new AgentID((isBrowser ? 'WebGW-' : 'NodeGW-')+_guid(4)); // gateway agent name
692
692
  this.connector = this._createConnector(url);
693
693
  this._addGWCache(this);
694
694
  }
@@ -1525,6 +1525,7 @@ class CachingAgentID extends AgentID {
1525
1525
  }
1526
1526
  this.greedy = greedy;
1527
1527
  this.cache = {};
1528
+ this.specialParams = ['name', 'version'];
1528
1529
  }
1529
1530
 
1530
1531
  /**
@@ -1539,6 +1540,7 @@ class CachingAgentID extends AgentID {
1539
1540
  async set(params, values, index=-1, timeout=5000) {
1540
1541
  let s = await super.set(params, values, index, timeout);
1541
1542
  this._updateCache(params, s, index);
1543
+ return s;
1542
1544
  }
1543
1545
 
1544
1546
  /**
@@ -1552,7 +1554,9 @@ class CachingAgentID extends AgentID {
1552
1554
  */
1553
1555
  async get(params, index=-1, timeout=5000, maxage=5000) {
1554
1556
  if (this._isCached(params, index, maxage)) return this._getCache(params, index);
1555
- if (this.greedy && !(Array.isArray(params) && params.includes('name')) && params != 'name') {
1557
+ if (this.greedy &&
1558
+ !(Array.isArray(params) && [...new Set([...params, ...this.specialParams])].length!=0) &&
1559
+ !this.specialParams.includes(params)) {
1556
1560
  let rsp = await super.get(null, index, timeout);
1557
1561
  this._updateCache(null, rsp, index);
1558
1562
  if (!rsp) return Array.isArray(params) ? new Array(params.length).fill(null) : null;
package/dist/esm/unet.js CHANGED
@@ -1,6 +1,6 @@
1
- /* unet.js v2.0.5 2022-06-15T07:40:54.241Z */
1
+ /* unet.js v2.0.8 2022-07-21T08:08:24.416Z */
2
2
 
3
- /* fjage.js v1.10.1 */
3
+ /* fjage.js v1.10.2 */
4
4
 
5
5
  const isBrowser =
6
6
  typeof window !== "undefined" && typeof window.document !== "undefined";
@@ -666,7 +666,7 @@ class Gateway {
666
666
  this.eventListeners = {}; // external listeners wanting to listen internal events
667
667
  this.queue = []; // incoming message queue
668
668
  this.debug = false; // debug info to be logged to console?
669
- this.aid = new AgentID(isBrowser ? 'WebGW-' : 'NodeGW-'+_guid(4)); // gateway agent name
669
+ this.aid = new AgentID((isBrowser ? 'WebGW-' : 'NodeGW-')+_guid(4)); // gateway agent name
670
670
  this.connector = this._createConnector(url);
671
671
  this._addGWCache(this);
672
672
  }
@@ -1503,6 +1503,7 @@ class CachingAgentID extends AgentID {
1503
1503
  }
1504
1504
  this.greedy = greedy;
1505
1505
  this.cache = {};
1506
+ this.specialParams = ['name', 'version'];
1506
1507
  }
1507
1508
 
1508
1509
  /**
@@ -1517,6 +1518,7 @@ class CachingAgentID extends AgentID {
1517
1518
  async set(params, values, index=-1, timeout=5000) {
1518
1519
  let s = await super.set(params, values, index, timeout);
1519
1520
  this._updateCache(params, s, index);
1521
+ return s;
1520
1522
  }
1521
1523
 
1522
1524
  /**
@@ -1530,7 +1532,9 @@ class CachingAgentID extends AgentID {
1530
1532
  */
1531
1533
  async get(params, index=-1, timeout=5000, maxage=5000) {
1532
1534
  if (this._isCached(params, index, maxage)) return this._getCache(params, index);
1533
- if (this.greedy && !(Array.isArray(params) && params.includes('name')) && params != 'name') {
1535
+ if (this.greedy &&
1536
+ !(Array.isArray(params) && [...new Set([...params, ...this.specialParams])].length!=0) &&
1537
+ !this.specialParams.includes(params)) {
1534
1538
  let rsp = await super.get(null, index, timeout);
1535
1539
  this._updateCache(null, rsp, index);
1536
1540
  if (!rsp) return Array.isArray(params) ? new Array(params.length).fill(null) : null;
package/dist/unetjs.js CHANGED
@@ -4,7 +4,7 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.unet = {}));
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
- /* fjage.js v1.10.1 */
7
+ /* fjage.js v1.10.2 */
8
8
 
9
9
  const isBrowser =
10
10
  typeof window !== "undefined" && typeof window.document !== "undefined";
@@ -670,7 +670,7 @@
670
670
  this.eventListeners = {}; // external listeners wanting to listen internal events
671
671
  this.queue = []; // incoming message queue
672
672
  this.debug = false; // debug info to be logged to console?
673
- this.aid = new AgentID(isBrowser ? 'WebGW-' : 'NodeGW-'+_guid(4)); // gateway agent name
673
+ this.aid = new AgentID((isBrowser ? 'WebGW-' : 'NodeGW-')+_guid(4)); // gateway agent name
674
674
  this.connector = this._createConnector(url);
675
675
  this._addGWCache(this);
676
676
  }
@@ -1507,6 +1507,7 @@
1507
1507
  }
1508
1508
  this.greedy = greedy;
1509
1509
  this.cache = {};
1510
+ this.specialParams = ['name', 'version'];
1510
1511
  }
1511
1512
 
1512
1513
  /**
@@ -1521,6 +1522,7 @@
1521
1522
  async set(params, values, index=-1, timeout=5000) {
1522
1523
  let s = await super.set(params, values, index, timeout);
1523
1524
  this._updateCache(params, s, index);
1525
+ return s;
1524
1526
  }
1525
1527
 
1526
1528
  /**
@@ -1534,7 +1536,9 @@
1534
1536
  */
1535
1537
  async get(params, index=-1, timeout=5000, maxage=5000) {
1536
1538
  if (this._isCached(params, index, maxage)) return this._getCache(params, index);
1537
- if (this.greedy && !(Array.isArray(params) && params.includes('name')) && params != 'name') {
1539
+ if (this.greedy &&
1540
+ !(Array.isArray(params) && [...new Set([...params, ...this.specialParams])].length!=0) &&
1541
+ !this.specialParams.includes(params)) {
1538
1542
  let rsp = await super.get(null, index, timeout);
1539
1543
  this._updateCache(null, rsp, index);
1540
1544
  if (!rsp) return Array.isArray(params) ? new Array(params.length).fill(null) : null;