From 6dace968b111deb9928976f27f0758e0ce9759d8 Mon Sep 17 00:00:00 2001 From: Utkarsh Dixit Date: Sat, 31 Aug 2019 02:54:38 +0530 Subject: [PATCH] Remove loadash and use Set to get unique values --- packages/shipit-cli/src/Shipit.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/shipit-cli/src/Shipit.js b/packages/shipit-cli/src/Shipit.js index 760ec29..89ac9c1 100644 --- a/packages/shipit-cli/src/Shipit.js +++ b/packages/shipit-cli/src/Shipit.js @@ -4,7 +4,6 @@ import LineWrapper from 'stream-line-wrapper' import Orchestrator from 'orchestrator' import chalk from 'chalk' import prettyTime from 'pretty-hrtime' -import _ from 'lodash' /** * An ExecResult returned when a command is executed with success. @@ -255,7 +254,7 @@ class Shipit extends Orchestrator { if(typeof copyOptions.rsync === 'string') { copyOptions.rsync = [copyOptions.rsync] } - copyOptions = {...copyOptions, rsync: _.uniq([...defaultOptions.rsync, ...copyOptions.rsync])} + copyOptions = {...copyOptions, rsync: [...new Set([...defaultOptions.rsync, ...copyOptions.rsync])]} return this.pool.copy(src, dest, copyOptions) } @@ -285,7 +284,7 @@ class Shipit extends Orchestrator { if(typeof copyOptions.rsync === 'string') { copyOptions.rsync = [copyOptions.rsync] } - copyOptions = {...copyOptions, rsync: _.uniq([...defaultOptions.rsync, ...copyOptions.rsync])} + copyOptions = {...copyOptions, rsync: [...new Set([...defaultOptions.rsync, ...copyOptions.rsync])]} return this.pool.copyToRemote(src, dest, copyOptions) } @@ -314,7 +313,7 @@ class Shipit extends Orchestrator { if(typeof copyOptions.rsync === 'string') { copyOptions.rsync = [copyOptions.rsync] } - copyOptions = {...copyOptions, rsync: _.uniq([...defaultOptions.rsync, ...copyOptions.rsync])} + copyOptions = {...copyOptions, rsync: [...new Set([...defaultOptions.rsync, ...copyOptions.rsync])]} return this.pool.copyFromRemote(src, dest, copyOptions) }