{"ScriptPreparationCode":"var mock = {\r\n name: \u0027Jos\u00E9 Manuel\u0027,\r\n surname: \u0027Lucas\u0027,\r\n organization: {\r\n id: 11,\r\n selfcare: {\r\n id: 12355,\r\n customization: {\r\n colors: {\r\n foreground: \u0027#fff\u0027,\r\n background: {\r\n primary: \u0027#ff0000\u0027,\r\n }\r\n }\r\n }\r\n }\r\n },\r\n};\r\n\r\nconst getName = ({ name }) =\u003E name;\r\n\r\nconst getOrganization = obj =\u003E obj \u0026\u0026 obj.organization;\r\n\r\nconst getSelfcare = (obj) =\u003E {\r\n const a = getOrganization(obj);\r\n return a \u0026\u0026 a.selfcare;\r\n};\r\n\r\nconst getCustomization = (obj) =\u003E {\r\n const a = getSelfcare(obj);\r\n return a \u0026\u0026 a.customization;\r\n};\r\n\r\nconst getColors = (obj) =\u003E {\r\n const a = getCustomization(obj);\r\n return a \u0026\u0026 a.colors;\r\n};\r\n\r\nvar imperativePath = (obj) =\u003E {\r\n const a = getColors(obj);\r\n return a \u0026\u0026 a.foreground;\r\n};\r\n\r\nconst { pipe, prop, defaultTo } = R;\r\n\r\nconst organizationSelector = prop(\u0027organization\u0027);\r\nconst selfcareSelector = pipe(\r\n organizationSelector,\r\n prop(\u0027selfcare\u0027),\r\n);\r\n \r\nconst customizationSelector = pipe(\r\n selfcareSelector,\r\n prop(\u0027customization\u0027),\r\n);\r\n \r\nconst colorsSelector = pipe(\r\n customizationSelector,\r\n prop(\u0027colors\u0027),\r\n);\r\n\r\nvar ramdaPath = pipe(\r\n colorsSelector,\r\n prop(\u0027foreground\u0027),\r\n);\r\n\r\n// Ensuring that all functions work properly\r\nif (ramdaPath(mock) !== \u0027#fff\u0027) {\r\n throw new Error(\u0027Invalid ramda path\u0027);\r\n}\r\n\r\nif (imperativePath(mock) !== \u0027#fff\u0027) {\r\n throw new Error(\u0027Invalid imperative path\u0027);\r\n}","TestCases":[{"Name":"Imperative path","Code":"imperativePath(mock);","IsDeferred":false},{"Name":"Ramda path","Code":"ramdaPath(mock);","IsDeferred":false}]}