Skip to content

Commit

Permalink
chore(deps): Use crypto.randomUUID() instead of uuid module
Browse files Browse the repository at this point in the history
The `crypto` global is available in all supported Node.js versions as well as [in all major browsers](https://caniuse.com/mdn-api_crypto_randomuuid).
The uuid module is rendered unnecessary for uuidv4.
  • Loading branch information
nikeee committed Dec 5, 2024
1 parent d2b9e6e commit 2b9ec12
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
4 changes: 1 addition & 3 deletions packages/graphql/lib/utils/generate-token.util.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import { v4 } from 'uuid';

export const generateString = () => v4();
export const generateString = () => crypto.randomUUID();
1 change: 0 additions & 1 deletion packages/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"normalize-path": "3.0.0",
"subscriptions-transport-ws": "0.11.0",
"tslib": "2.8.1",
"uuid": "11.0.3",
"ws": "8.18.0"
},
"devDependencies": {
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10729,11 +10729,6 @@ [email protected]:
resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz"
integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==

[email protected]:
version "11.0.3"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-11.0.3.tgz#248451cac9d1a4a4128033e765d137e2b2c49a3d"
integrity sha512-d0z310fCWv5dJwnX1Y/MncBAqGMKEzlBb1AOf7z9K8ALnd0utBX/msg/fA0+sbyN1ihbMsLhrBlnl1ak7Wa0rg==

uuid@^10.0.0:
version "10.0.0"
resolved "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz"
Expand Down

0 comments on commit 2b9ec12

Please sign in to comment.