libshv-js 3.3.0 → 3.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libshv-js",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "Typescript implementation of libshv",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
package/src/rpcmessage.ts CHANGED
@@ -142,14 +142,14 @@ class RpcMessage {
142
142
  }
143
143
 
144
144
  const error_map = this.value[KeyError];
145
- if (!(typeof error_map[ERROR_CODE] !== 'number')) {
145
+ if (typeof error_map[ERROR_CODE] !== 'number') {
146
146
  return new ProtocolError('Response had an error, but this error did not contain at least an error code');
147
147
  }
148
148
 
149
- const code = error_map[ERROR_CODE];
149
+ const code = error_map[ERROR_CODE] as unknown;
150
150
 
151
151
  const ErrorType = (() => {
152
- switch (code.value) {
152
+ switch (code) {
153
153
  case ErrorCode.InvalidRequest: return InvalidRequest;
154
154
  case ErrorCode.MethodNotFound: return MethodNotFound;
155
155
  case ErrorCode.InvalidParams: return InvalidParams;