Skip to content

Commit

Permalink
dumb
Browse files Browse the repository at this point in the history
  • Loading branch information
inetol committed Mar 5, 2024
1 parent 1f7f99d commit 10b101e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/utils/StringUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export class StringUtils {
return string;
}

public static generateKey(length: number): string {
public static generateKey(length: number = Server.config.documents.defaultKeyLength): string {
if (
ValidatorUtils.isLengthWithinRange(
!ValidatorUtils.isLengthWithinRange(
length,
Server.config.documents.minKeyLength,
Server.config.documents.maxKeyLength
Expand All @@ -32,10 +32,9 @@ export class StringUtils {
return Bun.file(Server.config.documents.documentPath + key).exists();
}

public static async createKey(length: number | undefined): Promise<string> {
public static async createKey(length: number = Server.config.documents.defaultKeyLength): Promise<string> {
if (
!length ||
ValidatorUtils.isLengthWithinRange(
!ValidatorUtils.isLengthWithinRange(
length,
Server.config.documents.minKeyLength,
Server.config.documents.maxKeyLength
Expand Down

0 comments on commit 10b101e

Please sign in to comment.