Skip to content

Commit

Permalink
feat(chore): added withSpace option to convert
Browse files Browse the repository at this point in the history
  • Loading branch information
Intevel committed Jun 25, 2022
1 parent 96e190a commit 977f477
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ const gitmojis = {
export function convert(content: string, withSpace?: boolean) {
if (!withSpace) withSpace = false;
Object.entries(gitmojis).forEach(([key, value]) => {
content = content.replaceAll(key, value);
if (withSpace) {
content = content.replaceAll(key, value + " ");
} else {
content = content.replaceAll(key, value);
}
});
return content;
}

0 comments on commit 977f477

Please sign in to comment.