-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sweep: Update the docstrings and comments in sdks/ts/src/utils/isVali…
…dUuid4.ts to fix any issues and mismatch between the comment and associated code (#240) * feat: Updated sdks/ts/src/utils/isValidUuid4.ts * refactor: Lint agents-api (CI) --------- Co-authored-by: sweep-ai[bot] <128439645+sweep-ai[bot]@users.noreply.github.com> Co-authored-by: sweep-ai[bot] <sweep-ai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
9d23412
commit 53ebb10
Showing
3 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
import { validate as uuidValidate, version as uuidVersion } from "uuid"; | ||
|
||
/** | ||
* Checks if the input string is a valid UUID v4. | ||
* Validates if the input string is a valid UUID v4. | ||
* This function performs a two-step validation process: | ||
* 1. Validates the format of the UUID using `uuidValidate`. | ||
* 2. Checks that the version of the UUID is 4 using `uuidVersion`. | ||
* @param {string} uuidToTest The string to test for a valid UUID v4. | ||
* @returns {boolean} True if the input is a valid UUID v4, otherwise false. | ||
*/ | ||
export function isValidUuid4(uuidToTest: string): boolean { | ||
// Validate the UUID format and check its version is 4 | ||
return uuidValidate(uuidToTest) && uuidVersion(uuidToTest) === 4; | ||
} |