Skip to content

Commit

Permalink
Replace clone-deep with structuredClone (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
eltoder authored Feb 4, 2025
1 parent 77ff0e2 commit b95f543
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 51 deletions.
48 changes: 0 additions & 48 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"@react-spring/web": "^9.4.4",
"@stripe/stripe-js": "^1.25.0",
"chart.js": "^3.7.1",
"clone-deep": "^4.0.1",
"clsx": "^1.1.1",
"firebase": "^9.6.9",
"moment": "^2.29.1",
Expand Down
3 changes: 1 addition & 2 deletions src/hooks/useStats.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import cloneDeep from "clone-deep";
import { useMemo } from "react";

import { BASE_RATING, modes } from "../game";
Expand All @@ -16,7 +15,7 @@ function useStats(userId) {
return value;
}

const stats = cloneDeep(value) ?? {};
const stats = structuredClone(value) ?? {};
for (const mode of Object.keys(modes)) {
stats[mode] ??= {};
stats[mode].rating ??= BASE_RATING;
Expand Down

0 comments on commit b95f543

Please sign in to comment.