From 4187ad2243fa748afec33313e36fd68f96bd0085 Mon Sep 17 00:00:00 2001 From: Jon Church Date: Mon, 5 Jan 2026 13:31:51 -0500 Subject: [PATCH 1/2] refactor(json): simplify strict mode error string construction --- lib/types/json.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/types/json.js b/lib/types/json.js index 058fcc62..23c73577 100644 --- a/lib/types/json.js +++ b/lib/types/json.js @@ -102,11 +102,7 @@ function createStrictSyntaxError (str, char) { var partial = '' if (index !== -1) { - partial = str.substring(0, index) + JSON_SYNTAX_CHAR - - for (var i = index + 1; i < str.length; i++) { - partial += JSON_SYNTAX_CHAR - } + partial = str.substring(0, index) + JSON_SYNTAX_CHAR.repeat(str.length - index) } try { From 80d8944315274e475df1970587515c6c597ffc42 Mon Sep 17 00:00:00 2001 From: Jon Church Date: Mon, 5 Jan 2026 13:45:07 -0500 Subject: [PATCH 2/2] update history.md --- HISTORY.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index 716afc6d..94429c1a 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,7 @@ +Unreleased +========================= +* refactor(json): simplify strict mode error string construction + 2.2.1 / 2025-11-24 =========================