diff --git a/typescript/type-orm/package-lock.json b/typescript/type-orm/package-lock.json index 15eba222..5ba79c10 100644 --- a/typescript/type-orm/package-lock.json +++ b/typescript/type-orm/package-lock.json @@ -14,8 +14,7 @@ "npm-run-all": "^4.1.5", "pg": "^8.13.1", "ts-node": "^10.9.2", - "typeorm": "^0.3.28", - "uuid": "^11.0.3" + "typeorm": "^0.3.28" }, "devDependencies": { "@types/jest": "^30.0.0", diff --git a/typescript/type-orm/package.json b/typescript/type-orm/package.json index 1d78e76a..a45990e2 100644 --- a/typescript/type-orm/package.json +++ b/typescript/type-orm/package.json @@ -14,7 +14,7 @@ "typeorm": "ts-node ./node_modules/typeorm/cli.js", "start": "node dist/index.js", "dev": "npm run clean && npm run build && npm run start", - "test": "npm run clean && npm run build && jest dist/test" + "test": "npm run clean && npm run build && node --experimental-vm-modules node_modules/jest/bin/jest.js dist/test" }, "author": "", "license": "ISC", @@ -31,8 +31,7 @@ "npm-run-all": "^4.1.5", "pg": "^8.13.1", "ts-node": "^10.9.2", - "typeorm": "^0.3.28", - "uuid": "^11.0.3" + "typeorm": "^0.3.28" }, "engines": { "node": ">=18.0.0" diff --git a/typescript/type-orm/src/entity/Owner.ts b/typescript/type-orm/src/entity/Owner.ts index 6da08161..00419229 100644 --- a/typescript/type-orm/src/entity/Owner.ts +++ b/typescript/type-orm/src/entity/Owner.ts @@ -1,7 +1,7 @@ import "reflect-metadata"; +import { randomUUID } from "crypto"; import { Column, Entity, PrimaryColumn, OneToMany } from "typeorm"; import { Pet } from "./Pet"; -import { v4 as uuidv4 } from "uuid"; @Entity("owner") export class Owner { @@ -38,7 +38,7 @@ export class Owner { constructor() { if(!this.id) { - this.id = uuidv4(); + this.id = randomUUID(); } } } \ No newline at end of file diff --git a/typescript/type-orm/src/entity/Pet.ts b/typescript/type-orm/src/entity/Pet.ts index dc505f10..0163acad 100644 --- a/typescript/type-orm/src/entity/Pet.ts +++ b/typescript/type-orm/src/entity/Pet.ts @@ -1,7 +1,7 @@ import "reflect-metadata"; +import { randomUUID } from "crypto"; import { Column, Entity, ManyToOne, PrimaryColumn, JoinColumn, RelationId } from "typeorm"; import { Owner } from "./Owner"; -import { v4 as uuidv4 } from "uuid"; @Entity("pet") export class Pet { @@ -36,7 +36,7 @@ export class Pet { constructor() { if (!this.id) { - this.id = uuidv4(); + this.id = randomUUID(); } } } \ No newline at end of file diff --git a/typescript/type-orm/src/entity/Vet.ts b/typescript/type-orm/src/entity/Vet.ts index 27a9e60a..73e790e0 100644 --- a/typescript/type-orm/src/entity/Vet.ts +++ b/typescript/type-orm/src/entity/Vet.ts @@ -1,7 +1,7 @@ import "reflect-metadata"; +import { randomUUID } from "crypto"; import { Column, Entity, PrimaryColumn, ManyToMany, JoinTable } from "typeorm"; import { Specialty } from "./Specialty"; -import { v4 as uuidv4 } from "uuid"; @Entity("vet") export class Vet { @@ -37,7 +37,7 @@ export class Vet { constructor() { if (!this.id) { - this.id = uuidv4(); + this.id = randomUUID(); } } } \ No newline at end of file diff --git a/typescript/type-orm/src/entity/VetSpecialty.ts b/typescript/type-orm/src/entity/VetSpecialty.ts index b5c0ea77..965f9aca 100644 --- a/typescript/type-orm/src/entity/VetSpecialty.ts +++ b/typescript/type-orm/src/entity/VetSpecialty.ts @@ -1,6 +1,6 @@ import "reflect-metadata"; +import { randomUUID } from "crypto"; import { Entity, Column, PrimaryColumn } from "typeorm"; -import { v4 as uuidv4 } from "uuid"; @Entity("vet_specialty") export class VetSpecialty { @@ -14,7 +14,7 @@ export class VetSpecialty { constructor() { if(!this.id) { - this.id = uuidv4(); + this.id = randomUUID(); } } } \ No newline at end of file