From cb6b538fc1262b6e66fd6c6df652703a9d0828d2 Mon Sep 17 00:00:00 2001 From: Ayoub Mabrouk Date: Sun, 25 Jan 2026 01:50:10 +0100 Subject: [PATCH] perf: add early exit in valueSlice for empty ranges --- src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.ts b/src/index.ts index 30fd59a..e261bd7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -500,6 +500,7 @@ function eqIndex(str: string, min: number, max: number) { * Slice out a value between startPod to max. */ function valueSlice(str: string, min: number, max: number) { + if (min >= max) return ""; let start = min; let end = max;