From 70104635c838b8167efef11febe921189fc0216e Mon Sep 17 00:00:00 2001 From: mayura-andrew Date: Wed, 31 Jul 2024 21:56:10 +0530 Subject: [PATCH] chore: Update package dependencies and remove unused entities --- package-lock.json | 23 +---------------------- package.json | 4 +--- src/entities/baseEntity.ts | 4 ++-- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6107b5fb..3f5305d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,8 +29,7 @@ "pg": "^8.10.0", "reflect-metadata": "^0.1.13", "ts-node": "^10.9.1", - "typeorm": "^0.3.16", - "uuid": "^10.0.0" + "typeorm": "^0.3.16" }, "devDependencies": { "@types/bcrypt": "^5.0.0", @@ -51,7 +50,6 @@ "@types/pg": "^8.10.1", "@types/prettier": "^2.7.2", "@types/supertest": "^2.0.12", - "@types/uuid": "^9.0.2", "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.59.5", "eslint": "^8.46.0", @@ -2497,12 +2495,6 @@ "@types/superagent": "*" } }, - "node_modules/@types/uuid": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.2.tgz", - "integrity": "sha512-kNnC1GFBLuhImSnV7w4njQkUiJi0ZXUycu1rUaouPqiKlXkh77JKgdRnTAp1x5eBwcIwbtI+3otwzuIDEuDoxQ==", - "dev": true - }, "node_modules/@types/yargs": { "version": "17.0.24", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", @@ -10770,19 +10762,6 @@ "node": ">= 0.4.0" } }, - "node_modules/uuid": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", - "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", diff --git a/package.json b/package.json index 5ce838c9..35714a15 100644 --- a/package.json +++ b/package.json @@ -41,8 +41,7 @@ "pg": "^8.10.0", "reflect-metadata": "^0.1.13", "ts-node": "^10.9.1", - "typeorm": "^0.3.16", - "uuid": "^10.0.0" + "typeorm": "^0.3.16" }, "devDependencies": { "@types/bcrypt": "^5.0.0", @@ -63,7 +62,6 @@ "@types/pg": "^8.10.1", "@types/prettier": "^2.7.2", "@types/supertest": "^2.0.12", - "@types/uuid": "^9.0.2", "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.59.5", "eslint": "^8.46.0", diff --git a/src/entities/baseEntity.ts b/src/entities/baseEntity.ts index 468c78a3..aa2d3037 100644 --- a/src/entities/baseEntity.ts +++ b/src/entities/baseEntity.ts @@ -1,10 +1,10 @@ +import { randomUUID } from 'crypto' import { BeforeInsert, BeforeUpdate, Column, PrimaryGeneratedColumn } from 'typeorm' -import { v4 as uuidv4 } from 'uuid' class BaseEntity { @PrimaryGeneratedColumn('uuid') @@ -28,7 +28,7 @@ class BaseEntity { @BeforeInsert() async generateUuid(): Promise { if (!this.uuid) { - this.uuid = uuidv4() + this.uuid = randomUUID() } } }