mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-13 15:46:24 +00:00
Remove code dependencies to underscore
This commit is contained in:
parent
8c4a67e59c
commit
2a3eb14899
@ -1,5 +1,6 @@
|
||||
let async = require('async');
|
||||
const _ = require('underscore');
|
||||
|
||||
const utils = require('../utils/utils.js');
|
||||
|
||||
const ContractDeployer = require('./contract_deployer.js');
|
||||
const cloneDeep = require('clone-deep');
|
||||
|
@ -447,6 +447,25 @@ function interceptLogs(consoleContext, logger) {
|
||||
};
|
||||
}
|
||||
|
||||
function compact(array) {
|
||||
return array.filter(n => n);
|
||||
}
|
||||
|
||||
function groupBy(array, key) {
|
||||
return array.reduce(function(rv, x) {
|
||||
(rv[x[key]] = rv[x[key]] || []).push(x);
|
||||
return rv;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function sample(array) {
|
||||
return array[Math.floor(Math.random() * array.length)];
|
||||
}
|
||||
|
||||
function last(array) {
|
||||
return array[array.length - 1];
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
joinPath,
|
||||
dirname,
|
||||
|
Loading…
x
Reference in New Issue
Block a user