rettiwt-api 2.0.1 → 2.0.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.
package/README.md CHANGED
@@ -34,7 +34,7 @@ The following examples may help you to get started using the library:
34
34
 
35
35
  ```
36
36
  // Creating a new Rettiwt instance using the API_KEY
37
- const rettiwt = Rettiwt(API_KEY);
37
+ const rettiwt = new Rettiwt(API_KEY);
38
38
 
39
39
  // Fetching the details of the user whose username is <username>
40
40
  rettiwt.user.details('<username>')
@@ -50,7 +50,7 @@ rettiwt.user.details('<username>')
50
50
 
51
51
  ```
52
52
  // Creating a new Rettiwt instance using the API_KEY
53
- const rettiwt = Rettiwt(API_KEY);
53
+ const rettiwt = new Rettiwt(API_KEY);
54
54
 
55
55
  /**
56
56
  * Fetching the list of tweets that:
@@ -46,7 +46,7 @@ var CursoredData = /** @class */ (function () {
46
46
  this.list.push(new Tweet_1.Tweet(item));
47
47
  }
48
48
  // If the item is a valid raw user
49
- else if (item.__typename == 'User' && item.rest_id) {
49
+ else if (item.__typename == 'User' && item.rest_id && item.id) {
50
50
  this.list.push(new User_1.User(item));
51
51
  }
52
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CursoredData.js","sourceRoot":"","sources":["../../src/models/CursoredData.ts"],"names":[],"mappings":";;;AAGA,SAAS;AACT,iCAAgC;AAChC,+BAA8B;AAK9B;;;;GAIG;AACH;IAIC;;;;OAIG;IACH,gBAAY,SAAiB;QAC5B,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACxB,CAAC;IACF,aAAC;AAAD,CAAC,AAZD,IAYC;AAZY,wBAAM;AAcnB;;;;;;GAMG;AACH;IAOC;;;OAGG;IACH,sBAAY,IAAmC,EAAE,IAAiB;QAAtD,qBAAA,EAAA,SAAmC;QAAE,qBAAA,EAAA,SAAiB;QAVlE,0CAA0C;QAC1C,SAAI,GAAQ,EAAE,CAAC;QAUd,8DAA8D;QAC9D,KAAmB,UAAI,EAAJ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,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,aAAK,CAAC,IAAiB,CAAM,CAAC,CAAC;aAClD;YACD,kCAAkC;iBAC7B,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,IAAI,IAAI,CAAC,OAAO,IAAK,IAAiB,CAAC,EAAE,EAAE;gBAC5E,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,WAAI,CAAC,IAAgB,CAAM,CAAC,CAAC;aAChD;SACD;QAED,uBAAuB;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IACF,mBAAC;AAAD,CAAC,AA3BD,IA2BC;AA3BY,oCAAY"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rettiwt-api",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "An API for fetching data from TwitterAPI, without any rate limits!",
@@ -53,7 +53,7 @@ export class CursoredData<T extends Tweet | User> implements ICursoredData<T> {
53
53
  this.list.push(new Tweet(item as IRawTweet) as T);
54
54
  }
55
55
  // If the item is a valid raw user
56
- else if (item.__typename == 'User' && item.rest_id) {
56
+ else if (item.__typename == 'User' && item.rest_id && (item as IRawUser).id) {
57
57
  this.list.push(new User(item as IRawUser) as T);
58
58
  }
59
59
  }