From 52055adfc1b4d1f2673003d2ab81b482baa11cb8 Mon Sep 17 00:00:00 2001 From: Steven Levithan Date: Fri, 28 Jun 2024 20:00:09 +0200 Subject: [PATCH] Replace dependency emoji-regex with emoji-regex-xs --- index.js | 3 +-- package.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index d9861fa..c2d7902 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ import stripAnsi from 'strip-ansi'; import {eastAsianWidth} from 'get-east-asian-width'; -import emojiRegex from 'emoji-regex'; +import emojiRegex from 'emoji-regex-xs'; const segmenter = new Intl.Segmenter(); @@ -38,7 +38,6 @@ export default function stringWidth(string, options = {}) { continue; } - // TODO: Use `/\p{RGI_Emoji}/v` when targeting Node.js 20. if (emojiRegex().test(character)) { width += 2; continue; diff --git a/package.json b/package.json index dcb5c3a..54af506 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "east-asian-width" ], "dependencies": { - "emoji-regex": "^10.3.0", + "emoji-regex-xs": "^1.0.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" },