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 Jan 3, 2025
1 parent 9eea93b commit ff3d19a
Show file tree
Hide file tree
Showing 3 changed files with 3,860 additions and 3,183 deletions.
3 changes: 1 addition & 2 deletions lib/common/sequelize.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Logger, Type } from '@nestjs/common';
import { Observable } from 'rxjs';
import { delay, retryWhen, scan } from 'rxjs/operators';
import { Sequelize } from 'sequelize-typescript';
import { v4 as uuid } from 'uuid';
import { CircularDependencyException } from '../exceptions/circular-dependency.exception';
import { SequelizeModuleOptions } from '../interfaces';
import { DEFAULT_CONNECTION_NAME } from '../sequelize.constants';
Expand Down Expand Up @@ -94,4 +93,4 @@ export function getConnectionName(options: SequelizeModuleOptions) {
return options && options.name ? options.name : DEFAULT_CONNECTION_NAME;
}

export const generateString = () => uuid();
export const generateString = () => crypto.randomUUID();
Loading

0 comments on commit ff3d19a

Please sign in to comment.