Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
timonson committed Sep 4, 2023
1 parent 8a027e0 commit 1aa8eb3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions strings/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ function replaceAll(toBeReplaced) {
input.replace(new RegExp(toBeReplaced, "g"), replacement);
}

export const replaceSpacesWithHyphens = replaceAll(/\s+/)("-");
export const replaceSpacesWithUnderscores = replaceAll(/\s+/)("_");

function pad(character) {
return (minimumLength) => (input) => {
const remaining = minimumLength - length(input);
Expand Down

0 comments on commit 1aa8eb3

Please sign in to comment.