{"ScriptPreparationCode":" function transformOld(value) {\r\n return value\r\n // remove d_, dt_ case insensitive\r\n .replace(/(^dt?_)/i, \u0027\u0027)\r\n // remove jn_ case insensitive\r\n .replace(/(^jn_)/i, \u0027\u0027)\r\n // insert a space between lower \u0026 upper and correct case\r\n .replace(\r\n /([a-z])(_?)([A-Z])(.)/g, (match, endOfLower, underscorePrefix, firstUpperCaseCharacter, secondCharacter) =\u003E {\r\n if (!underscorePrefix \u0026\u0026 secondCharacter !== secondCharacter.toUpperCase()) {\r\n firstUpperCaseCharacter = firstUpperCaseCharacter.toLowerCase();\r\n }\r\n return \u0060${endOfLower} ${firstUpperCaseCharacter}${secondCharacter}\u0060;\r\n }\r\n )\r\n // remove all _\r\n .replace(/_\u002B/g, \u0027 \u0027)\r\n // space before last upper in a sequence followed by lower\r\n .replace(/([A-Z]\u002B)([A-Z])/g, (match, beforeLastUpper, lastUpper) =\u003E \u0060${beforeLastUpper} ${lastUpper.toLowerCase()}\u0060)\r\n // uppercase the first character\r\n .replace(/^./, (str) =\u003E str.toUpperCase())\r\n }\r\n\r\n function transformNew(value) {\r\n return _.flow(\r\n removePrefixes,\r\n splitLowerUpperCaseAndFixCase,\r\n splitUnderscore,\r\n splitAllUpperLowerCase,\r\n upperCaseFirstCharacter\r\n )(value);\r\n }\r\n\r\n function removePrefixes(value) {\r\n return value.replace(/(^dt?_|^jn_)/i, \u0027\u0027);\r\n }\r\n\r\n function splitLowerUpperCaseAndFixCase(value) {\r\n return value.replace(\r\n /([a-z])(_?)([A-Z])(.)/g,\r\n (match, endOfLower, underscorePrefix, firstUpperCaseCharacter, secondCharacter) =\u003E {\r\n if (!underscorePrefix \u0026\u0026 secondCharacter !== secondCharacter.toUpperCase()) {\r\n firstUpperCaseCharacter = firstUpperCaseCharacter.toLowerCase();\r\n }\r\n return \u0060${endOfLower} ${firstUpperCaseCharacter}${secondCharacter}\u0060;\r\n }\r\n );\r\n }\r\n\r\n function splitUnderscore(value) {\r\n return value.replace(/_\u002B/g, \u0027 \u0027);\r\n }\r\n\r\n function splitAllUpperLowerCase(value) {\r\n return value.replace(\r\n /([A-Z]\u002B)([A-Z])/g,\r\n (match, beforeLastUpper, lastUpper) =\u003E \u0060${beforeLastUpper} ${lastUpper.toLowerCase()}\u0060\r\n );\r\n }\r\n\r\n function upperCaseFirstCharacter(value) {\r\n return value.replace(/^./, (str) =\u003E str.toUpperCase());\r\n }\r\n\r\n function transformWithoutFlow(value) {\r\n return upperCaseFirstCharacter(splitAllUpperLowerCase(splitUnderscore(splitLowerUpperCaseAndFixCase(removePrefixes(value)))));\r\n }\r\n\r\nvar testString = \u0027abcdefHij_Klm\u0027;","TestCases":[{"Name":"transformOld","Code":"transformOld(testString);","IsDeferred":false},{"Name":"transformNew","Code":"transformNew(testString);","IsDeferred":false},{"Name":"transformWithoutFlow","Code":"transformWithoutFlow(testString);","IsDeferred":false}]}