@wildix/xbees-connect 1.0.5 → 1.0.6-alpha.0

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.0.4-alpha.10",
3
+ "version": "1.0.5",
4
4
  "description": "This library provides easy communication between x-bees and integrated web applications",
5
5
  "author": "dimitri.chernykh <dimitri.chernykh@wildix.com>",
6
6
  "homepage": "",
@@ -14,7 +14,7 @@
14
14
  "build:es": "tsc -p tsconfig.es.json",
15
15
  "build:types": "tsc -p tsconfig.types.json",
16
16
  "build:docs": "typedoc",
17
- "lint": "eslint .",
17
+ "lint": "eslint . && tsc --noEmit",
18
18
  "lint:fix": "eslint . --fix",
19
19
  "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo"
20
20
  },
@@ -24,7 +24,6 @@ export class Client {
24
24
  }
25
25
  }
26
26
  else {
27
- console.log('run daemon');
28
27
  void this.getInstance().ready();
29
28
  }
30
29
  }
@@ -50,7 +49,7 @@ export class Client {
50
49
  }
51
50
  parseMessage(message) {
52
51
  try {
53
- const data = message?.data && JSON.parse(message?.data);
52
+ const data = typeof message.data === 'string' ? JSON.parse(message.data) : message.data;
54
53
  if (!data?.type) {
55
54
  return null;
56
55
  }
@@ -59,9 +59,7 @@ export type Response<T extends Payload = Payload> = {
59
59
  errorMessage?: string;
60
60
  payload?: T;
61
61
  };
62
- export type RawMessage = {
63
- data?: string;
64
- };
62
+ export type RawMessageEvent = MessageEvent<'string' | Message>;
65
63
  export type SendPayload = {
66
64
  type: ClientEventType;
67
65
  payload?: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-connect",
3
- "version": "1.0.5",
3
+ "version": "1.0.6-alpha.0",
4
4
  "description": "This library provides easy communication between x-bees and integrated web applications",
5
5
  "author": "dimitri.chernykh <dimitri.chernykh@wildix.com>",
6
6
  "homepage": "",
@@ -41,5 +41,5 @@
41
41
  "engines": {
42
42
  "node": ">=16"
43
43
  },
44
- "gitHead": "6ae6cab588627f05f5af7808e8b1a70e75b6829d"
44
+ "gitHead": "e0b53be49487f418b06dd171a3068b9ffefe6197"
45
45
  }