Skip to content

Commit

Permalink
docs: add docs for invertString
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcath committed Mar 28, 2023
1 parent e9bd10f commit 08836f0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/functions/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ export const rndFromString = (string: string, base: number = 1) => {
return Math.round((n - Math.floor(n)) * base)
}

/**
* Inverts alphabetic characters, `abc` becomes `zyx`.
*
* @param string The string to invert
*/
export const invertString = (string: string) => {
return string
.split('')
Expand Down

0 comments on commit 08836f0

Please sign in to comment.