Skip to content

Commit

Permalink
refactor: remove warnings when builder already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
SocketSomeone committed Jan 13, 2024
1 parent 73b24a9 commit bf93026
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/necord-pagination.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,12 @@ export class NecordPaginationService {
public register(factory: (builder: PaginationBuilder) => PaginationBuilder): PaginationBuilder {
const builder = factory(new PaginationBuilder(this.options));

if (this.cache.has(builder.customId)) {
this.logger.warn(`Pagination : ${builder.customId} already exists`);
}

this.cache.set(builder.customId, builder);

return builder;
}

public get(customId: string): PaginationBuilder {
if (!this.cache.has(customId)) {
this.logger.warn(`Pagination : ${customId} doesn't exists`);
}

return this.cache.get(customId);
}

Expand Down

0 comments on commit bf93026

Please sign in to comment.