Fix flaky isGraphQLTweet handling

This commit is contained in:
dangered wolf 2023-11-12 03:18:58 -05:00
parent 6d72d5dd16
commit 0cf2a8ba67
No known key found for this signature in database
GPG key ID: 41E4D37680ED8B58

View file

@ -18,7 +18,6 @@ export const isGraphQLTweet = (response: unknown): response is GraphQLTweet => {
response !== null &&
(('__typename' in response &&
(response.__typename === 'Tweet' || response.__typename === 'TweetWithVisibilityResults')) ||
// @ts-expect-error it's 6 am please let me sleep
('legacy' in response && response.legacy?.full_text))
typeof (response as GraphQLTweet).legacy?.full_text === 'string')
);
};