From b5fb022d27fa5ebe0f19ada4549ba2471efba38f Mon Sep 17 00:00:00 2001 From: Dawid Motak Date: Fri, 26 Apr 2024 16:56:37 +0200 Subject: [PATCH] chore(deps): replace external uuid dependency with node:crypto --- lib/utils/create-config-factory.util.ts | 4 +-- package-lock.json | 33 +------------------------ package.json | 4 +-- 3 files changed, 4 insertions(+), 37 deletions(-) diff --git a/lib/utils/create-config-factory.util.ts b/lib/utils/create-config-factory.util.ts index 2c89467f..89bbb7b4 100644 --- a/lib/utils/create-config-factory.util.ts +++ b/lib/utils/create-config-factory.util.ts @@ -1,8 +1,8 @@ import { FactoryProvider } from '@nestjs/common/interfaces'; -import { v4 as uuid } from 'uuid'; import { ConfigFactory } from '../interfaces'; import { getConfigToken } from './get-config-token.util'; import { ConfigFactoryKeyHost } from './register-as.util'; +import { randomUUID } from "crypto"; /** * @publicApi @@ -11,7 +11,7 @@ export function createConfigProvider( factory: ConfigFactory & ConfigFactoryKeyHost, ): FactoryProvider { return { - provide: factory.KEY || getConfigToken(uuid()), + provide: factory.KEY || getConfigToken(randomUUID()), useFactory: factory, inject: [], }; diff --git a/package-lock.json b/package-lock.json index d5d2cc11..9735f17b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,8 +11,7 @@ "dependencies": { "dotenv": "16.4.5", "dotenv-expand": "10.0.0", - "lodash": "4.17.21", - "uuid": "9.0.1" + "lodash": "4.17.21" }, "devDependencies": { "@commitlint/cli": "19.3.0", @@ -24,7 +23,6 @@ "@types/jest": "29.5.12", "@types/lodash": "4.17.0", "@types/node": "20.12.7", - "@types/uuid": "9.0.8", "@typescript-eslint/eslint-plugin": "7.8.0", "@typescript-eslint/parser": "7.8.0", "eslint": "8.57.0", @@ -3247,12 +3245,6 @@ "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", "dev": true }, - "node_modules/@types/uuid": { - "version": "9.0.8", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", - "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", - "dev": true - }, "node_modules/@types/yargs": { "version": "17.0.10", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.10.tgz", @@ -12353,18 +12345,6 @@ "node": ">= 0.4.0" } }, - "node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/v8-to-istanbul": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", @@ -15083,12 +15063,6 @@ "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", "dev": true }, - "@types/uuid": { - "version": "9.0.8", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", - "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", - "dev": true - }, "@types/yargs": { "version": "17.0.10", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.10.tgz", @@ -21535,11 +21509,6 @@ "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", "dev": true }, - "uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==" - }, "v8-to-istanbul": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", diff --git a/package.json b/package.json index 6977c2b8..ebcaf122 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,7 @@ "dependencies": { "dotenv": "16.4.5", "dotenv-expand": "10.0.0", - "lodash": "4.17.21", - "uuid": "9.0.1" + "lodash": "4.17.21" }, "devDependencies": { "@commitlint/cli": "19.3.0", @@ -33,7 +32,6 @@ "@types/jest": "29.5.12", "@types/lodash": "4.17.0", "@types/node": "20.12.7", - "@types/uuid": "9.0.8", "@typescript-eslint/eslint-plugin": "7.8.0", "@typescript-eslint/parser": "7.8.0", "eslint": "8.57.0",