{"ScriptPreparationCode":"var Cache = /** @class */ (function () {\r\n function Cache() {\r\n this.internalCache = new Map();\r\n }\r\n Cache.prototype.get = function (key, cb) {\r\n if (this.internalCache.has(key)) {\r\n return this.internalCache.get(key);\r\n }\r\n var value = cb();\r\n this.internalCache.set(key, value);\r\n return value;\r\n };\r\n return Cache;\r\n }());\r\n\r\nwindow.cacheInstance = new Cache();","TestCases":[{"Name":"With cache","Code":"window.cacheInstance.get(\u0027isRootDomain\u0027, () =\u003E {\r\n const origin = window.location.origin\r\n // Lazy way to count number of \u0022.\u0022 characters\r\n const matches = origin.match(/\\./g);\r\n return !!(matches \u0026\u0026 matches.length === 1);\r\n});","IsDeferred":false},{"Name":"without cache","Code":"(function() {\r\n const origin = window.location.origin\r\n // Lazy way to count number of \u0022.\u0022 characters\r\n const matches = origin.match(/\\./g);\r\n return !!(matches \u0026\u0026 matches.length === 1);\r\n})();","IsDeferred":false}]}