Remove code dependencies to underscore

This commit is contained in:
Anthony Laibe 2018-07-24 13:29:06 +01:00 committed by Iuri Matias
parent e86b922f40
commit df19b3a8fb
3 changed files with 12189 additions and 0 deletions

View File

@ -39,6 +39,7 @@ class NpmTimer{
else{
// otherwise, find our download complete measurement
entry = utils.last(items.getEntries().filter(entry => entry.name === this._downloadComplete));
if(entry){
strDuration = __('Finished downloading and installing {{packageName}} {{version}} in {{duration}}ms', {packageName: this._packageName, version: this._version, duration: entry.duration});
performance.clearMarks();

View File

@ -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,

12169
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff