Skip to content

Commit

Permalink
Restore deleted function
Browse files Browse the repository at this point in the history
  • Loading branch information
Hopding committed Oct 16, 2021
1 parent ed6a7b3 commit 5fdefe9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export const copyStringIntoBuffer = (
return length;
};

export const addRandomSuffix = (prefix: string, suffixLength = 4) =>
`${prefix}-${Math.floor(Math.random() * 10 ** suffixLength)}`;

export const escapeRegExp = (str: string) =>
str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');

Expand Down

0 comments on commit 5fdefe9

Please sign in to comment.