constructor(strings) { this.strings = strings; this.gropupByKey = lodash.groupBy(strings); }
}); list.data = _.groupBy(list.data, function(item) { return item.add_time; });
let groupByStatus = _.groupBy(response, (instance) => { return instance.status ? instance.status : other });
months = _.uniq([...months, ..._.map(servicesCancelled, (instance) => instance.updated_at.substring(0,7))]); let groupByMonthRunning = _.groupBy(servicesRunning, (instance) => { return instance.created_at.substring(0,7); }); let groupByMonthCancelled = _.groupBy(servicesCancelled, (instance) => { return instance.updated_at.substring(0,7); });
_(datatypes).groupBy('category').each((group, key) => { group = _.groupBy(group, (el) => el.sub_category || 'generic'); desc += `### ${key} Types`; _.each(group, (types, sKey) => { if (sKey === 'generic') { desc += toMdList(types, 1); } else { desc += `\n#### ${_.upperFirst(sKey)} Types`; desc += toMdList(types, 2); } }); });
B.getUserInventoryContents(SID, 753, 6, true, (ERR, INV, CURR) => { if (ERR) { callback(ERR); } else { INV = INV.filter((ITEM) => ITEM.getTag("item_class").internal_name == "item_class_2"); INV = INV.filter((ITEM) => ITEM.getTag("cardborder").internal_name == "cardborder_0"); var sInventory = INV; sInventory = _.groupBy(sInventory, (CEconItem) => CEconItem['market_hash_name'].split('-')[0]); _.forOwn(sInventory, function(CEconItemArray, appid) { sInventory[appid] = _.groupBy(CEconItemArray, 'classid'); }); callback(null, sInventory); } });
_.map(_.groupBy(errors, 'target'), (errs, target) => { return { target, messages: _.map(errs, err => { return { id: err.message, params: _.get(err, 'params', undefined) }; }) }; })
function _processBalance(list) { const group = _.groupBy(list, l => l.currency.toUpperCase()); const res = []; _.forEach(group, (arr, coin) => { const map = _.groupBy(arr, d => d.type); const locked = _.get(map.frozen, '0'); const trade = _.get(map.trade, '0'); const l = { coin }; if (locked) l.locked_balance = _parse(locked.balance); if (trade) l.balance = _parse(trade.balance); // if (locked && trade) l.total_balance = l.locked_balance + l.balance; res.push(l); }); return res;// _.filter(res, l => l.locked_balance || l.balance); 不要用 }
Shot .select(["shots.*"]) .withScores() .joins("INNER JOIN rounds ON rounds.id = scores.round_id") .where(options) .then(function(shots) { callback(_.groupBy(shots, 'score_id')); });
mergeLockFns(map) { const groups = _.groupBy(this.apiLockMap, 'endpoint'); _.forEach(map, (l) => { const arr = groups[l.id]; l.lock_count = arr ? arr.length : 0; }); }
function batchCancelMarginOrderO(o = []) { o = _.map(_.groupBy(o, 'pair'), (l, pair) => { return { instrument_id: pair.toLowerCase(), order_ids: _.map(l, _l => _l.order_id).slice(0, 9) }; }); return o; }
_.groupBy(this.q.workers, function(n){ return n.type })
_.groupBy( questions, question => question.subcategory )
const getDoctrineTags = documentation => { return _.groupBy(documentation.tags, 'title'); }
// 批量撤单 function batchCancelSpotOrdersO(o = {}) { o = _.map(_.groupBy(o, 'pair'), (l, pair) => { return { instrument_id: pair.toLowerCase(), order_ids: _.map(l, _l => _l.order_id).slice(0, 9) }; }); return o; }