ads-client 1.12.0 → 1.12.1

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/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.12.1] - 17.01.2022
8
+ ### Changed
9
+ - Updated dependecies to latest versions
10
+ - ([See issue #80](https://github.com/jisotalo/ads-client/issues/80))
11
+ - Updated `toString()` methods from `ads-client-ads.js` (problem with undefined variable)
12
+
7
13
  ## [1.12.0] - 28.12.2021
8
14
  ### Changed
9
15
  - Improving handling of connection losses ([See pull request #78](https://github.com/jisotalo/ads-client/pull/78))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ads-client",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "Beckhoff TwinCAT ADS client library for Node.js (unofficial). Connects to Beckhoff TwinCAT automation systems using ADS protocol.",
5
5
  "main": "./src/ads-client.js",
6
6
  "scripts": {
@@ -33,9 +33,9 @@
33
33
  "url": "https://github.com/jisotalo/ads-client.git"
34
34
  },
35
35
  "dependencies": {
36
- "debug": "^4.3.1",
37
- "iconv-lite": "^0.5.2",
38
- "long": "^4.0.0"
36
+ "debug": "^4.3.3",
37
+ "iconv-lite": "^0.6.3",
38
+ "long": "^5.2.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "docdash": "^1.2.0",
@@ -255,9 +255,9 @@ const ADS_COMMAND = {
255
255
  Notification: 8,
256
256
  //ReadWrite Command
257
257
  ReadWrite: 9,
258
-
258
+
259
259
  toString: function (value) {
260
- return ((ret = Object.keys(this).find(key => this[key] == value)) != null ? ret : 'UNKNOWN')
260
+ return (Object.keys(this).find(key => this[key] == value)) || 'UNKNOWN';
261
261
  }
262
262
  }
263
263
  exports.ADS_COMMAND = ADS_COMMAND
@@ -489,7 +489,7 @@ const ADS_STATE = {
489
489
  Exception: 19,
490
490
 
491
491
  toString: function (value) {
492
- return ((ret = Object.keys(this).find(key => this[key] == value)) != null ? ret : 'UNKNOWN')
492
+ return (Object.keys(this).find(key => this[key] == value)) || 'UNKNOWN';
493
493
  }
494
494
  }
495
495
  exports.ADS_STATE = ADS_STATE
@@ -602,9 +602,8 @@ const ADS_RESERVED_INDEX_GROUPS = {
602
602
  //DeviceData (0xF100,61696)
603
603
  DeviceData: 61696, // 0x0000F100
604
604
 
605
-
606
605
  toString: function (value) {
607
- return ((ret = Object.keys(this).find(key => this[key] == value)) != null ? ret : 'UNKNOWN')
606
+ return (Object.keys(this).find(key => this[key] == value)) || 'UNKNOWN'
608
607
  }
609
608
  }
610
609
  exports.ADS_RESERVED_INDEX_GROUPS = ADS_RESERVED_INDEX_GROUPS
@@ -795,7 +794,7 @@ const ADS_DATA_TYPES = {
795
794
  ADST_BIGTYPE: 65, // 0x00000041
796
795
 
797
796
  toString: function (value) {
798
- return ((ret = Object.keys(this).find(key => this[key] == value)) != null ? ret : 'UNKNOWN')
797
+ return (Object.keys(this).find(key => this[key] == value)) || 'UNKNOWN'
799
798
  }
800
799
  }
801
800
  exports.ADS_DATA_TYPES = ADS_DATA_TYPES
@@ -847,7 +846,7 @@ const AMS_ROUTER_STATE = {
847
846
  REMOVED: 2,
848
847
 
849
848
  toString: function (value) {
850
- return ((ret = Object.keys(this).find(key => this[key] == value)) != null ? ret : 'UNKNOWN')
849
+ return (Object.keys(this).find(key => this[key] == value)) || 'UNKNOWN'
851
850
  }
852
851
  }
853
852
  exports.AMS_ROUTER_STATE = AMS_ROUTER_STATE