From c3fba96cb5f2596245529d0def25f26b2e82db93 Mon Sep 17 00:00:00 2001 From: Victor Korzunin Date: Sun, 13 Sep 2020 22:34:36 +0200 Subject: [PATCH] fix(deprecation): use Date.now instead of lodash.now --- package.json | 2 -- src/packExternalModules.ts | 9 ++++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 28c84faa..ddcad26a 100644 --- a/package.json +++ b/package.json @@ -61,8 +61,6 @@ "esbuild": ">=0.6", "fs-extra": "^9.0.1", "globby": "^11.0.1", - "lodash.now": "^4.0.2", - "lodash.remove": "^4.7.0", "ramda": "^0.27.0" } } diff --git a/src/packExternalModules.ts b/src/packExternalModules.ts index d02b11d2..bb03954d 100644 --- a/src/packExternalModules.ts +++ b/src/packExternalModules.ts @@ -1,5 +1,4 @@ import * as fse from 'fs-extra'; -import * as now from 'lodash.now'; import * as path from 'path'; import { compose, @@ -218,16 +217,16 @@ export async function packExternalModules() { } } - const start = now(); + const start = Date.now(); this.serverless.cli.log('Packing external modules: ' + compositeModules.join(', ')); await packager.install(compositeModulePath); - this.options.verbose && this.serverless.cli.log(`Package took [${now() - start} ms]`); + this.options.verbose && this.serverless.cli.log(`Package took [${Date.now() - start} ms]`); // Prune extraneous packages - removes not needed ones - const startPrune = now(); + const startPrune = Date.now(); await packager.prune(compositeModulePath); this.options.verbose && - this.serverless.cli.log(`Prune: ${compositeModulePath} [${now() - startPrune} ms]`); + this.serverless.cli.log(`Prune: ${compositeModulePath} [${Date.now() - startPrune} ms]`); // GOOGLE: Copy modules only if not google-cloud-functions // GCF Auto installs the package json