{"ScriptPreparationCode":null,"TestCases":[{"Name":"with regex","Code":"function getDisplayName(definitionName) {\r\n const bundleId = getBundleId(definitionName);\r\n\r\n return name.substring(name.lastIndexOf(\u0027:\u0027) \u002B 1);\r\n }\r\n\r\nfunction getBundleId(definitionName) {\r\n const matches = definitionName.match(/(.\u002B):/);\r\n\r\n return (matches \u0026\u0026 matches.pop()) || \u0027\u0027;\r\n}\r\n\r\nconst res = getDisplayName(\u0027foo:bar\u0027);","IsDeferred":false},{"Name":"with split","Code":"function getDisplayName(definitionName) {\r\n const bundleId = getBundleId(definitionName);\r\n\r\n return name.substring(name.lastIndexOf(\u0027:\u0027) \u002B 1);\r\n }\r\n\r\nfunction getBundleId(definitionName) {\r\n\tconst matches = definitionName.split(\u0027:\u0027);\r\n\r\n return matches[0]|| \u0027\u0027;\r\n}\r\n\r\nconst res = getDisplayName(\u0027foo:bar\u0027);","IsDeferred":false},{"Name":"without both","Code":"function getDisplayName(definitionName) {\r\n return definitionName.substring(definitionName.lastIndexOf(\u0027:\u0027) \u002B 1);\r\n}\r\n\r\nconst res = getDisplayName(\u0027foo:bar\u0027);","IsDeferred":false}]}