From 0b6b8b3da3bd1974f26e6b65fa9bb0f3cb001200 Mon Sep 17 00:00:00 2001 From: Stefan Bethke Date: Wed, 5 Oct 2016 18:15:05 +0200 Subject: [PATCH] Improve readability --- lib/output.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/output.js b/lib/output.js index dd94fea5..ad2ccecb 100644 --- a/lib/output.js +++ b/lib/output.js @@ -138,8 +138,7 @@ function OutputStream(options) { var re = options.xml_safe ? /[\x00-\x1f\x22\x27\u2028\u2029\0\ud800-\udfff\ufeff\ufffe\uffff]/g : /[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g; - str = str.replace(re, - function(s, i){ + str = str.replace(re, function(s, i){ switch (s) { case '"': ++dq; return '"'; case "'": ++sq; return "'";