Skip to content

Commit

Permalink
docs: Add JSDoc documentation to uuid.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
madjin committed Dec 29, 2024
1 parent 9134d3c commit 3b33f2f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/core/src/uuid.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { sha1 } from "js-sha1";
import { UUID } from "./types.ts";

/**
* Converts a string or number to a UUID.
*
* @param {string | number} target - The string or number to convert to a UUID.
* @throws {TypeError} If the value is not a string.
* @returns {UUID} The converted UUID.
*/
export function stringToUuid(target: string | number): UUID {
if (typeof target === "number") {
target = (target as number).toString();
Expand Down

0 comments on commit 3b33f2f

Please sign in to comment.