Skip to content

Commit

Permalink
refactor: use crypto module and move uuid to devDependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafatcb committed Jun 15, 2024
1 parent b7f063f commit 3103c21
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion errors/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { v4 as uuid } from 'uuid';
import { randomUUID as uuid } from 'crypto';

class BaseError extends Error {
constructor({
Expand Down
2 changes: 1 addition & 1 deletion models/content.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { randomUUID as uuidV4 } from 'crypto';
import slug from 'slug';
import { v4 as uuidV4 } from 'uuid';

import { ForbiddenError, ValidationError } from 'errors';
import database from 'infra/database.js';
Expand Down
2 changes: 1 addition & 1 deletion models/controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { randomUUID as uuidV4 } from 'crypto';
import snakeize from 'snakeize';
import { v4 as uuidV4 } from 'uuid';

import {
ForbiddenError,
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"snakeize": "0.1.0",
"styled-components": "5.3.11",
"swr": "2.2.4",
"uuid": "9.0.1",
"vis-network": "9.1.9"
},
"devDependencies": {
Expand Down Expand Up @@ -73,6 +72,7 @@
"react-email": "2.0.0",
"retry-cli": "0.7.0",
"set-cookie-parser": "2.6.0",
"uuid": "9.0.1",
"vite-tsconfig-paths": "4.3.1",
"vitest": "1.3.1"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { randomUUID as uuidV4 } from 'crypto';
import nextConnect from 'next-connect';
import snakeize from 'snakeize';
import { v4 as uuidV4 } from 'uuid';

import { ForbiddenError, TooManyRequestsError, UnauthorizedError } from 'errors';
import logger from 'infra/logger.js';
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/api/v1/status/votes/get.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { v4 as uuidV4, version as uuidVersion } from 'uuid';
import { randomUUID as uuidV4 } from 'node:crypto';
import { version as uuidVersion } from 'uuid';

import orchestrator from 'tests/orchestrator.js';

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/models/prestige.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { v4 as uuidV4 } from 'uuid';
import { randomUUID as uuidV4 } from 'node:crypto';

import prestige from 'models/prestige';

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/models/reward.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { v4 as uuidV4 } from 'uuid';
import { randomUUID as uuidV4 } from 'node:crypto';

import database, { mockQuery, mockRelease } from 'infra/database';
import balance from 'models/balance';
Expand Down

0 comments on commit 3103c21

Please sign in to comment.