From 775dbd0f43e14a47532f1a16becc161fed0c198b Mon Sep 17 00:00:00 2001 From: Garrett Wu Date: Fri, 26 Feb 2021 07:02:12 -0800 Subject: [PATCH] upgrade uuid dep to support bundler tree shaking See https://github.com/uuidjs/uuid/blob/master/README_js.md#deep-requires-now-deprecated From the above document, the motivation for upgrading: As of uuid@7.x this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. --- index.js | 2 +- package.json | 2 +- yarn.lock | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index add8ac70..5b866269 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,7 @@ const looselyValidate = require('@segment/loosely-validate-event') const axios = require('axios') const axiosRetry = require('axios-retry') const ms = require('ms') -const uuid = require('uuid/v4') +const { v4: uuid } = require('uuid') const md5 = require('md5') const version = require('./package.json').version const isString = require('lodash.isstring') diff --git a/package.json b/package.json index 698df677..f65d1e45 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "md5": "^2.2.1", "ms": "^2.0.0", "remove-trailing-slash": "^0.1.0", - "uuid": "^3.2.1" + "uuid": "^8.3.2" }, "devDependencies": { "ava": "^0.25.0", diff --git a/yarn.lock b/yarn.lock index c185f6de..7a2efcd4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6179,10 +6179,15 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= -uuid@^3.0.1, uuid@^3.2.1, uuid@^3.3.2: +uuid@^3.0.1, uuid@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" +uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"