Skip to content

Commit

Permalink
add jsdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
timreichen committed Aug 6, 2024
1 parent 6bcd670 commit b3f0390
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions text/slugify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,20 @@ function replaceChars(string: string) {
.join("");
}

/**
* Converts a string into a slug.
*
* @example Usage
* ```ts
* import { slugify } from "@std/text/slugify";
* import { assertEquals } from "@std/assert";
*
* assertEquals(slugify("déjà vu"),"deja-vu");
* ```
*
* @param input The string that is going to be converted into a slug
* @returns The string as a slug
*/
export function slugify(input: string): string {
return replaceChars(input)
.trim()
Expand Down

0 comments on commit b3f0390

Please sign in to comment.