libshv-js 7.1.11 → 7.1.13

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/chainpack.js CHANGED
@@ -91,13 +91,13 @@ class ChainPackReader {
91
91
  }
92
92
  const key = this.read();
93
93
  const val = this.read();
94
- if ((map[rpcvalue_1.shvMapType] === 'metamap' && typeof key === 'string') ||
95
- (map[rpcvalue_1.shvMapType] === 'metamap' && typeof key === 'number') ||
96
- (map[rpcvalue_1.shvMapType] === 'map' && typeof key === 'string')) {
94
+ if ((typeof key === 'string' && map[rpcvalue_1.shvMapType] === 'metamap') ||
95
+ (typeof key === 'number' && map[rpcvalue_1.shvMapType] === 'metamap') ||
96
+ (typeof key === 'string' && map[rpcvalue_1.shvMapType] === 'map')) {
97
97
  map[key] = val;
98
98
  // eslint-disable-next-line unicorn/no-duplicate-if-branches -- the type system needs this branch
99
99
  }
100
- else if (map[rpcvalue_1.shvMapType] === 'imap' && typeof key === 'number') {
100
+ else if (typeof key === 'number' && map[rpcvalue_1.shvMapType] === 'imap') {
101
101
  map[key] = val;
102
102
  }
103
103
  else {
package/dist/cpon.js CHANGED
@@ -100,16 +100,16 @@ class CponReader {
100
100
  }
101
101
  this.skipWhitespace();
102
102
  const val = this.read();
103
- if (map[rpcvalue_1.shvMapType] === 'metamap' && typeof key === 'string') {
103
+ if (typeof key === 'string' && map[rpcvalue_1.shvMapType] === 'metamap') {
104
104
  map[key] = val;
105
105
  }
106
- else if (map[rpcvalue_1.shvMapType] === 'metamap' && (key instanceof rpcvalue_1.UInt || typeof key === 'number')) {
106
+ else if ((typeof key === 'number' || key instanceof rpcvalue_1.UInt) && map[rpcvalue_1.shvMapType] === 'metamap') {
107
107
  map[Number(key)] = val;
108
108
  }
109
- else if (map[rpcvalue_1.shvMapType] === 'map' && typeof key === 'string') {
109
+ else if (typeof key === 'string' && map[rpcvalue_1.shvMapType] === 'map') {
110
110
  map[key] = val;
111
111
  }
112
- else if (map[rpcvalue_1.shvMapType] === 'imap' && (key instanceof rpcvalue_1.UInt || typeof key === 'number')) {
112
+ else if ((typeof key === 'number' || key instanceof rpcvalue_1.UInt) && map[rpcvalue_1.shvMapType] === 'imap') {
113
113
  map[Number(key)] = val;
114
114
  }
115
115
  else {
@@ -133,7 +133,7 @@ class CponReader {
133
133
  b = this.ctx.peekByte();
134
134
  // console.log("CHAR:", b, String.fromCodePoint(b));
135
135
  // [0-9+-]
136
- if ((b >= 48 && b <= 57) || b === 43 || b === 45) {
136
+ if (b === 43 || b === 45 || (b >= 48 && b <= 57)) {
137
137
  return implReturn(this.readNumber());
138
138
  }
139
139
  if (b === '"'.codePointAt(0)) {
package/dist/rpcvalue.js CHANGED
@@ -94,7 +94,7 @@ class RpcValueWithMetaData {
94
94
  constructor(meta, value) {
95
95
  this.meta = meta;
96
96
  this.value = value;
97
- /* nothing */
97
+ // nothing
98
98
  }
99
99
  }
100
100
  exports.RpcValueWithMetaData = RpcValueWithMetaData;
package/dist/ws-client.js CHANGED
@@ -33,7 +33,7 @@ class RequestHandler {
33
33
  options;
34
34
  constructor(options) {
35
35
  this.options = options;
36
- /* nothing */
36
+ // nothing
37
37
  }
38
38
  }
39
39
  exports.RequestHandler = RequestHandler;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libshv-js",
3
- "version": "7.1.11",
3
+ "version": "7.1.13",
4
4
  "description": "Typescript implementation of libshv",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -40,9 +40,9 @@
40
40
  "@typescript-eslint/parser": "^8.56.1",
41
41
  "@eslint/js": "^10.0.1",
42
42
  "eslint": "^10.0.0",
43
- "eslint-config-xo": "^0.57.0",
43
+ "eslint-config-xo": "^1.0.0",
44
44
  "eslint-formatter-unix": "^9.0.1",
45
- "eslint-plugin-unicorn": "^71.0.0",
45
+ "eslint-plugin-unicorn": "^73.0.0",
46
46
  "typescript": "^6.0.2",
47
47
  "typescript-eslint": "^8.46.1"
48
48
  }