node-easywechat 2.9.2 → 2.9.3

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.
@@ -4,6 +4,6 @@ export declare class News extends Message {
4
4
  protected type: string;
5
5
  protected properties: Array<string>;
6
6
  constructor(items?: Array<NewsItem>);
7
- propertiesToArray(data: any, aliases?: any[]): object;
7
+ propertiesToObject(data: any, aliases?: any[]): object;
8
8
  toXmlArray(): object;
9
9
  }
@@ -11,12 +11,15 @@ class News extends Message_1.Message {
11
11
  'items',
12
12
  ];
13
13
  }
14
- propertiesToArray(data, aliases = []) {
14
+ propertiesToObject(data, aliases = []) {
15
15
  let newItems = [];
16
16
  try {
17
17
  this.get('items').forEach(item => {
18
18
  if (item instanceof NewsItem_1.NewsItem) {
19
- newItems.push(item.toXmlArray());
19
+ newItems.push(item.toJsonArray());
20
+ }
21
+ else {
22
+ newItems.push(item);
20
23
  }
21
24
  });
22
25
  }
@@ -4,5 +4,5 @@ export declare class News extends Message {
4
4
  protected type: string;
5
5
  protected properties: Array<string>;
6
6
  constructor(items: Array<NewsItem>);
7
- propertiesToArray(data: any, aliases?: any[]): object;
7
+ propertiesToObject(data: any, aliases?: any[]): object;
8
8
  }
@@ -11,13 +11,16 @@ class News extends Message_1.Message {
11
11
  this.type = 'news';
12
12
  this.properties = ['items'];
13
13
  }
14
- propertiesToArray(data, aliases = []) {
14
+ propertiesToObject(data, aliases = []) {
15
15
  let newItems = [];
16
16
  try {
17
17
  this.get('items').forEach(item => {
18
18
  if (item instanceof NewsItem_1.NewsItem) {
19
19
  newItems.push(item.toJsonArray());
20
20
  }
21
+ else {
22
+ newItems.push(item);
23
+ }
21
24
  });
22
25
  }
23
26
  catch (e) { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-easywechat",
3
- "version": "2.9.2",
3
+ "version": "2.9.3",
4
4
  "description": "EasyWechat SDK for Node.js (NOT OFFICIAL)",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {