FeedHive / twitter-api-client

A user-friendly Node.js / JavaScript client library for interacting with the Twitter API.
MIT License
948 stars 84 forks source link

make retweeted_status optional #85

Closed goleary closed 3 years ago

goleary commented 3 years ago

After digging into json-to-ts it looks like there is support for optional properties using a curious syntax (--? added to the end of the property key). You can see it here.

I tested it with retweeted_status in tweet-template.json & it worked as expected, producing this result:

export default interface StatusesHomeTimeline {
  ...
  retweeted_status?: Retweetedstatus;
}

I can't say I love this method as it requires modifying the raw JSON being returned from Twitter & is more error prone, but it seems better than nothing.

(copied from here)

SimonHoiberg commented 3 years ago

You're killing it man, this is awesome!