diff --git a/package.json b/package.json index 6c67e34..bdf9c56 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,6 @@ "tar": "4.4.18", "tree-kill": "1.2.2", "uid-promise": "1.0.0", - "uuid": "3.3.2", "xdg-app-paths": "5.1.0", "yauzl-promise": "2.1.3" }, @@ -51,7 +50,6 @@ "@types/node": "10.12.29", "@types/node-fetch": "2.5.0", "@types/tar": "4.0.0", - "@types/uuid": "8.3.1", "@types/yauzl-promise": "2.1.0", "codecov": "3.7.1", "cpy-cli": "2.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4f57c66..698bd26 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,9 +56,6 @@ dependencies: uid-promise: specifier: 1.0.0 version: 1.0.0 - uuid: - specifier: 3.3.2 - version: 3.3.2 xdg-app-paths: specifier: 5.1.0 version: 5.1.0 @@ -91,9 +88,6 @@ devDependencies: '@types/tar': specifier: 4.0.0 version: 4.0.0 - '@types/uuid': - specifier: 8.3.1 - version: 8.3.1 '@types/yauzl-promise': specifier: 2.1.0 version: 2.1.0 @@ -939,10 +933,6 @@ packages: '@types/node': 10.12.29 dev: true - /@types/uuid@8.3.1: - resolution: {integrity: sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg==} - dev: true - /@types/yargs-parser@21.0.0: resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} dev: true @@ -5698,6 +5688,7 @@ packages: resolution: {integrity: sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==} deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. hasBin: true + dev: true /v8-to-istanbul@8.1.1: resolution: {integrity: sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w==} diff --git a/src/providers/native/index.ts b/src/providers/native/index.ts index 02be37b..9e8df3b 100644 --- a/src/providers/native/index.ts +++ b/src/providers/native/index.ts @@ -1,5 +1,4 @@ import ms from 'ms'; -import uuid from 'uuid/v4'; import createDebug from 'debug'; import { promisify } from 'util'; import { AddressInfo } from 'net'; @@ -77,10 +76,9 @@ export default class NativeProvider implements Provider { const memorySize = typeof params.MemorySize === 'number' ? params.MemorySize : 128; const logGroupName = `aws/lambda/${functionName}`; - const logStreamName = `2019/01/12/[${version}]${uuid().replace( - /\-/g, - '' - )}`; + const logStreamName = `2019/01/12/[${version}]${crypto + .randomUUID() + .replace(/\-/g, '')}`; // https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html const env = { diff --git a/src/runtime-server.ts b/src/runtime-server.ts index 8728d69..5b513ed 100644 --- a/src/runtime-server.ts +++ b/src/runtime-server.ts @@ -3,7 +3,6 @@ import { parse } from 'url'; import { Server } from 'http'; import createDebug from 'debug'; import { run, text } from 'micro'; -import { v4 as uuid } from 'uuid'; import createPathMatch from 'path-match'; import once from '@tootallnate/once'; @@ -44,7 +43,7 @@ export class RuntimeServer extends Server { this.nextDeferred = createDeferred(); this.invokeDeferred = null; this.resultDeferred = null; - this.currentRequestId = uuid(); + this.currentRequestId = crypto.randomUUID(); } async serve(