Skip to content

Instantly share code, notes, and snippets.

@iamdaniele
Created September 7, 2022 01:32
Show Gist options
  • 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