How to use the reject function from underscore
Find comprehensive JavaScript underscore.reject code examples handpicked from public code repositorys.
GitHub: ONLYOFFICE/server
1524 1525 1526 1527 1528 1529 1530 1531 1532 1533
var isView = tmpUser.view; ctx.logger.info("Connection closed or timed out: reason = %s", reason); var isCloseCoAuthoringTmp = conn.isCloseCoAuthoring; if (reason) { //Notify that participant has gone connections = _.reject(connections, function(el) { return el.id === conn.id;//Delete this connection }); //Check if it's not already reconnected reconnected = yield* isUserReconnect(ctx, docId, tmpUser.id, conn.id);
171
146
32
+ 7 other calls in file
GitHub: keyteki/keyteki
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081
await userService.deleteBlocklistEntry(user, lowerCaseUser); } catch (err) { return res.send({ success: false, message: 'Block list entry failed to remove' }); } user.blockList = _.reject(user.blockList, (user) => { return user === lowerCaseUser; }); let updatedUser = await userService.getUserById(user.id);
79
121
8
73 74 75 76 77 78 79 80 81 82
provinceCard: _.find(provinceOne, (card) => card.isProvince), dynastyCards: _.reject(provinceOne, (card) => card.isProvince) }, 'province 2': { provinceCard: _.find(provinceTwo, (card) => card.isProvince), dynastyCards: _.reject(provinceTwo, (card) => card.isProvince) }, 'province 3': { provinceCard: _.find(provinceThree, (card) => card.isProvince), dynastyCards: _.reject(provinceThree, (card) => card.isProvince)
18
17
0
+ 13 other calls in file
GitHub: Ashteki/ashteki
300 301 302 303 304 305 306 307 308 309
this.playableLocations.push(playableLocation); return playableLocation; } removePlayableLocation(location) { this.playableLocations = _.reject(this.playableLocations, (l) => l === location); } beginRound() { this.passedMain = false;
9
10
1
GitHub: gautam-16/prod
1568 1569 1570 1571 1572 1573 1574 1575 1576 1577
emailIds.forEach(element => { decryptedEmailIds.push(element.toString()) }); decryptedEmailIds = _.uniq(decryptedEmailIds); addressIds.forEach(addressId => { let address = _.reject(keystaffObj,(element)=>{ return element.addressId != addressId })[0] let addressObj = { "addressId": address.addressId,
0
0
1
+ 94 other calls in file
GitHub: gautam-16/prod
530 531 532 533 534 535 536 537 538 539
return adminService.getSecurityAnswer(adminId) }) .then(function(data){ let securityQuestion = {}; securityQsList.forEach(element => { let securityAnswer = _.reject(data,(answerObj)=>{ return answerObj.secQsId != element.secQsId }) securityQuestion = element; if(securityAnswer && securityAnswer.length > 0)
0
0
1
32 33 34 35 36 37 38 39 40
}; result[idx++]=commentJson }) resolve({success:true, result}); }catch(err) { reject(`${err}`); } }) }
0
0
1
+ 7 other calls in file
95 96 97 98 99 100 101 102 103 104
function isDirEmptyPromise(folder){ return new Promise((resolve,reject)=>{ if(isDirEmpty(folder)){ resolve(); }else{ reject(); } }); }
0
0
1
+ 9 other calls in file
117 118 119 120 121 122 123 124 125 126 127
} }; xcode.project.prototype.removeFromPbxEmbedFrameworksBuildPhase = function (file) { const sources = this.pbxEmbedFrameworksBuildPhaseObj(file.target); if (sources) { sources.files = _.reject(sources.files, file => file.comment === longComment(file)); } }; // special handlers to add frameworks to the 'Embed Frameworks' build phase, needed for custom frameworks
0
0
0
underscore.keys is the most popular function in underscore (11266 examples)