get labels() { let labels = _.difference(this.data.labels, this.config.get('excludeLabels')); let include = this.config.get('includeLabels'); return include.length > 0 ? _.intersection(labels, include) : labels; }
function startFollowingAccounts(accounts=[]) { console.log( 'got # of accounts to follow: '+accounts.length ); let to_follow = _.difference( accounts, following ); console.log( '# of accounts after removing current following: '+to_follow.length ); library_auth.followAccounts(to_follow,["blog"]); }
test("difference", function() { var result = _.difference([1, 2, 3], [2, 30, 40]); equal(result.join(' '), '1 3', 'takes the difference of two arrays'); result = _.difference([1, 2, 3, 4], [2, 30, 40], [1, 11, 111]); equal(result.join(' '), '3 4', 'takes the difference of three arrays'); });
/** * parse the args and return the project argument * @returns {*} */ project() { if (!this.args[0] && !this.data.project) return null; if (this.data.project) return this.data.project; let projects = _.uniq(_.filter(this.args, arg => isNaN(new Number(arg)))); this.args = _.difference(this.args, projects); if(projects.length == 0) return null; return this.data.project = projects; }
_.each(app._services, value => { const name = value.loader.name; const depends = value.loader.depends || []; if(typeof value.loader !== 'function') { return log(`The ${name} service is not a function`); } if(depends.length) { const diff = _.difference(depends, app._loadedServices); if(diff.length) { return log(`The ${name} service depends on the [${diff.join(', ')}] services`); } } value.loader.call(app, value.opts); app._loadedServices.push(name); log(`Service loaded: ${name}, depends on: [${depends.join(', ')}]`); });
function appendAccountsToFollow(accounts=[]) { toFollow = _.union( accounts, toFollow ); console.log( "Total Accounts to Follow: "+toFollow.length ); if( ++counter == following.length ) { let to_follow = _.difference( toFollow, following ); library_auth.followAccounts(to_follow,["blog"]); } }
potentialTargets = _.difference(potentialTargets, reachableNodes);
.then (function () { $assert (_.difference (data, processedItems).isEmpty) }) },
function finishGetFollowers(followers=[]) { followersArray = followers; //Unfollow accounts that are no longer followers but were before: if( config.steem.unfollow_nonfollowers ) { var toUnfollow = _.difference( followingArray, followersArray ); console.log( 'old followers not following anymore: '+toUnfollow.length ); library_auth.followAccounts( toUnfollow, [""] ); } //Follow accounts that are now followers but weren't before: var toFollow = _.difference( followersArray, followingArray ); console.log( 'current followers not following before: '+toFollow.length ); library_auth.followAccounts( toFollow, ["blog"] ); }
user_mentions = _.difference(user_mentions, _.map(exclude_users, function(u) { return u.get('username'); }));
get labels() { let labels = _.difference(this.data.labels, this.config.get('excludeLabels')); let include = this.config.get('includeLabels'); return include.length > 0 ? _.intersection(labels, include) : labels; }
potentialTargets = _.difference(potentialTargets, reachableNodes);