{"ScriptPreparationCode":"function stringPrettify(text, capitalize = true, handleKebabCase = false) {\r\n let r = \u0022\u0022;\r\n let nextUpper = false;\r\n let wasUpper = false;\r\n for (let i = 0; i \u003C text.length; \u002B\u002Bi) {\r\n const c = text.charCodeAt(i);\r\n if (c \u003E 96 \u0026\u0026 c \u003C 123) {\r\n wasUpper = false;\r\n r \u002B= String.fromCharCode(nextUpper || i === 0 ? c - 32 : c);\r\n }\r\n else if (c \u003E 64 \u0026\u0026 c \u003C 91) {\r\n const cNext = text.charCodeAt(i \u002B 1);\r\n const isAbbr = i === text.length - 1 || (cNext \u003E 64 \u0026\u0026 cNext \u003C 91);\r\n const isAbbrPrev = wasUpper \u0026\u0026 isAbbr;\r\n if (!nextUpper \u0026\u0026 !isAbbrPrev \u0026\u0026 i !== 0) {\r\n r \u002B= \u0022 \u0022;\r\n }\r\n r \u002B= String.fromCharCode(capitalize || isAbbr || i === 0 ? c : c \u002B 32);\r\n wasUpper = true;\r\n }\r\n else if (c === 95 || (c === 45 \u0026\u0026 handleKebabCase)) {\r\n wasUpper = false;\r\n if (i !== 0) {\r\n r \u002B= \u0022 \u0022;\r\n }\r\n nextUpper = capitalize;\r\n continue;\r\n }\r\n else {\r\n r \u002B= String.fromCharCode(c);\r\n wasUpper = false;\r\n }\r\n nextUpper = false;\r\n }\r\n return r;\r\n}\r\n\r\nfunction stringPrettifyOld(text, capitalize = true) {\r\n const r = text\r\n .replace(/([A-Z\u0410-\u042F])/g, \u0022 $1\u0022)\r\n .trimStart()\r\n .replace(new RegExp(\u0060[_${(capitalize \u0026\u0026 \u0022-\u0022) || \u0022\u0022}]\u0060, \u0022g\u0022), \u0022 \u0022)\r\n .replace(/[ ]{2,}/, \u0022 \u0022);\r\n return r.charAt(0).toUpperCase() \u002B r.slice(1);\r\n}\r\n","TestCases":[{"Name":"Cycle for \u0026 charCode","Code":"let t = stringPrettify(\u0027somePropValue\u0027);\r\nlet t2 = stringPrettify(\u0027some_prop_value\u0027);\r\nlet t3 = stringPrettify(\u0027some-prop-value\u0027);","IsDeferred":false},{"Name":"Regex","Code":"let t = stringPrettifyOld(\u0027somePropValue\u0027);\r\nlet t2 = stringPrettifyOld(\u0027some_prop_value\u0027);\r\nlet t3 = stringPrettifyOld(\u0027some-prop-value\u0027);","IsDeferred":false}]}