How to use the union function from underscore
Find comprehensive JavaScript underscore.union code examples handpicked from public code repositorys.
GitHub: cliss/camel
876 877 878 879 880 881 882 883 884 885 886 887 888
app.post('/render-draft', [requireAuth, bodyParser.urlencoded({extended: true})], function (request, response) { var pieces = getLinesFromData(request.body.markdown); pieces.metadata = _.union(pieces.metadata, ["@@ BodyClass=post"]); //var titleIndex = pieces.metadata.findIndex(/^@@ Title=/); //pieces.metadata[titleIndex] = "@@ Title=DRAFT – " + pieces.metadata[titleIndex].substr(9) + " – DRAFT"; var result = generateHtmlAndMetadataForLines(pieces); response.send(result.html());
55
265
27
+ 38 other calls in file
GitHub: yonas/meteor-freebsd
317 318 319 320 321 322 323 324 325 326
reportOn(0, entry); }); }; var allLeafs = function () { return _.union(_.map(_.filter(entries, isLeaf), entryName)); }; var leafTotal = function (leafName) { var total = 0;
0
7
4
+ 5 other calls in file
GitHub: gautam-16/prod
3670 3671 3672 3673 3674 3675 3676 3677 3678 3679
.then(function(data){ //let actionplanQuestionIds = _.uniq(_.pluck(actionPlans,'questionId')) let customerActionQuestionIds = _.uniq(_.pluck(actionPlans,'questionId')); let customerQuestionIds = _.uniq(_.pluck(questionList,'questionId')); let questionIds = _.union(customerActionQuestionIds,customerQuestionIds); let customerPositiveActionPlan = _.reject(actionPlans,(planData)=>{ return !planData.isPositive }) let categoryPositiveActionPlan = _.reject(data,(planData)=>{
0
0
1
820 821 822 823 824 825 826 827 828 829
previousUpdateWasBigDelete = isBigDelete if (shouldConcat) { // check if the user in this update is already present in the earliest update, // if not, add them to the users list of the earliest update earliestUpdate.meta.user_ids = _.union(earliestUpdate.meta.user_ids, [ update.meta.user_id, ]) docId = update.doc_id.toString()
0
0
202
+ 5 other calls in file
underscore.keys is the most popular function in underscore (11266 examples)