Skip to content

Instantly share code, notes, and snippets.

@iamdaniele
Created September 7, 2022 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamdaniele/780a621a6c9589d25e2357b568d0bfdf to your computer and use it in GitHub Desktop.
Save iamdaniele/780a621a6c9589d25e2357b568d0bfdf to your computer and use it in GitHub Desktop.
const lookupUser = (tweet) => {
const authorId = tweet.data.author_id;
let author = {};
for (const user of tweet.includes.users) {
if (user.id === authorId) {
author = user;
return user;
}
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment