From 400a6ca5c23db8e71bf62d9ebf6082796ce5a7c6 Mon Sep 17 00:00:00 2001
From: Sindre Sorhus <sindresorhus@gmail.com>
Date: Tue, 21 May 2024 10:13:28 +0200
Subject: [PATCH] Meta tweaks

---
 index.js     | 4 +++-
 package.json | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/index.js b/index.js
index eb2b42d..6008790 100755
--- a/index.js
+++ b/index.js
@@ -7,6 +7,8 @@ const ESCAPES = new Set([27, 155]);
 const CODE_POINT_0 = '0'.codePointAt(0);
 const CODE_POINT_9 = '9'.codePointAt(0);
 
+const MAX_ANSI_SEQUENCE_LENGTH = 19;
+
 const endCodesSet = new Set();
 const endCodesMap = new Map();
 for (const [start, end] of ansiStyles.codes) {
@@ -48,7 +50,7 @@ function findNumberIndex(string) {
 }
 
 function parseAnsiCode(string, offset) {
-	string = string.slice(offset, offset + 19);
+	string = string.slice(offset, offset + MAX_ANSI_SEQUENCE_LENGTH);
 	const startIndex = findNumberIndex(string);
 	if (startIndex !== -1) {
 		let endIndex = string.indexOf('m', startIndex);
diff --git a/package.json b/package.json
index 3baa97a..edb3392 100644
--- a/package.json
+++ b/package.json
@@ -10,6 +10,7 @@
 		"types": "./index.d.ts",
 		"default": "./index.js"
 	},
+	"sideEffects": false,
 	"engines": {
 		"node": ">=18"
 	},