{"ScriptPreparationCode":"const obj= {\r\n\ttest1: {},\r\n \ttest2: {},\r\n \ttest3: {},\r\n \ttest4: {},\r\n \ttest5: {},\r\n \ttest6: {},\r\n \ttest7: {},\r\n}\r\n\r\n function getTypes(queryTypes) {\r\n const filterTypes = [];\r\n if (queryTypes \u0026\u0026 typeof queryTypes === \u0027string\u0027) {\r\n const types = queryTypes.split(\u0027,\u0027);\r\n for (let type of types) {\r\n filterTypes.push(type.toLowerCase());\r\n }\r\n }\r\n return Object.keys(obj).filter(\r\n t =\u003E !filterTypes.length || filterTypes.includes(t.toLowerCase())\r\n );\r\n }\r\n\r\nconst keys = Object.keys(obj).map(i =\u003E i.toLowerCase())\r\nfunction getTypes2(queryTypes) {\r\n const filterTypes = [];\r\n if (queryTypes \u0026\u0026 typeof queryTypes === \u0027string\u0027) {\r\n const types = queryTypes.split(\u0027,\u0027);\r\n for (let type of types) {\r\n filterTypes.push(type.toLowerCase());\r\n }\r\n }\r\n return keys.filter(\r\n t =\u003E !filterTypes.length || filterTypes.includes(t)\r\n );\r\n }\r\n\r\nconst map = Object.keys(obj).map(i =\u003E i.toLowerCase()).reduce((acc, i) =\u003E ({ ...acc, [i]: true }), {})\r\nfunction getTypes3(queryTypes) { \r\n if(!queryTypes || typeof queryTypes !== \u0027string\u0027) {\r\n return keys;\r\n }\r\n \r\n return queryTypes.split(\u0027,\u0027).filter(i =\u003E map[i.toLowerCase()])\r\n }","TestCases":[{"Name":"pr","Code":"getTypes(\u0027test2,test3,test6,test4,test5\u0027)","IsDeferred":false},{"Name":"move outside keys","Code":"getTypes2(\u0027test2,test3,test6,test4,test5\u0027)","IsDeferred":false},{"Name":"new","Code":"getTypes3(\u0027test2,test3,test6,test4,test5\u0027)","IsDeferred":false}]}