Skip to content

Commit

Permalink
fix(deprecation): use Date.now instead of lodash.now
Browse files Browse the repository at this point in the history
  • Loading branch information
floydspace committed Sep 13, 2020
1 parent f89960b commit c3fba96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
9 changes: 4 additions & 5 deletions src/packExternalModules.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as fse from 'fs-extra';
import * as now from 'lodash.now';
import * as path from 'path';
import {
compose,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c3fba96

Please sign in to comment.