Skip to content

Commit

Permalink
0.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dejurin committed May 13, 2024
1 parent 3544188 commit 96ba413
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,8 @@ export default function skinTone(emoji: string, tone?: SkinTone): string {
const modifiedParts = parts.map((part) => {
const basePart = part.replace(/\p{Emoji_Modifier}/gu, '');

const hasVS16 = /\uFE0F/.test(basePart);

if (/\p{Emoji_Modifier_Base}/u.test(basePart)) {
return basePart.replace(
/(\p{Extended_Pictographic}+)/u,
`$1${skinTonMap[tone]}${hasVS16 ? '\u{FE0F}' : ''}`,
);
return basePart.replace(/(\p{Extended_Pictographic}+)(\uFE0F?)/u, `$1${skinTonMap[tone]}`);
}
return part;
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qit.tools/skin-tone",
"version": "0.3.2",
"version": "0.3.3",
"description": "Change emoji skin tones effortlessly. πŸ§›πŸ§›πŸ»πŸ§›πŸΌπŸ§›πŸ½πŸ§›πŸΎπŸ§›πŸΏ",
"types": "./dist/types/index.d.ts",
"exports": {
Expand Down

0 comments on commit 96ba413

Please sign in to comment.