Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
let followers = [];
let following = [];
const sessionStorage = session._cookiesStore.storage
const accountId = (sessionStorage.idx['instagram.com'] || sessionStorage.idx['i.instagram.com'])['/'].ds_user_id.value
const compare = () => {
hashedFollowers = {}
followers.forEach((user) => hashedFollowers[user.id] = true);
let unfollowers = following.filter((user) => !hashedFollowers[user.id]);
resolve(unfollowers);
}
const getUsers = (newUsers, allUsers, usersGetter, otherUsersGetter) => {
newUsers.forEach((user) => allUsers.push(user))
// moreAvailable maybe null. We are dodging that.
if (usersGetter.moreAvailable === false && otherUsersGetter.moreAvailable === false){
compare();
} else if (usersGetter.moreAvailable !== false) {
usersGetter.get()