Skip to content

Commit

Permalink
Use uuid module
Browse files Browse the repository at this point in the history
  • Loading branch information
imertz committed Apr 27, 2023
1 parent e465f87 commit f599c2d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changeset/lovely-pandas-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"klironomiko": patch
---

Use uuid module
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { uuid } from "uuidv4";
import { v4 as uuidv4 } from "uuid";

type Relatives = {
spouse: Spouse;
Expand Down Expand Up @@ -60,7 +60,7 @@ export function calculateHeirPercentage(relatives: Relatives) {
return;
}

relative.uuid = uuid().replace(/-/g, "");
relative.uuid = uuidv4().replace(/-/g, "");

if (relative.descendants) {
relative.descendants.forEach((descendant) => {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
"devDependencies": {
"@changesets/cli": "^2.26.1",
"@types/node": "^18.16.0",
"@types/uuid": "^9.0.1",
"cli": "link:@@changesets/cli",
"tsup": "^6.7.0",
"typescript": "^5.0.4"
},
"dependencies": {
"uuidv4": "^6.2.13"
"uuid": "^9.0.0"
}
}
26 changes: 11 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f599c2d

Please sign in to comment.