{"ScriptPreparationCode":"const address_raw = [{ childrenIndex: 0 }, { toggleIndex: 1 }, { instanceIndex: 2 }, { childrenIndex: 0 }, { toggleIndex: 1 }, { instanceIndex: 2 }, { childrenIndex: 0 }, { toggleIndex: 1 }, { instanceIndex: 2 }, { childrenIndex: 0 }, { toggleIndex: 1 }, { instanceIndex: 2 }, { childrenIndex: 0 }, { toggleIndex: 1 }, { instanceIndex: 2 }];\r\n\r\nconst serializeAddressJSON = (address) =\u003E JSON.stringify(address);\r\nconst serializeAddressReduce = (address) =\u003E\r\n\taddress.reduce((serialized, point) =\u003E {\r\n\t\tconst { childrenIndex, toggleIndex, instanceIndex } = point;\r\n\r\n\t\tlet pointCode;\r\n\t\tif (childrenIndex !== undefined) {\r\n\t\t\tpointCode = \u0060c${childrenIndex}\u0060;\r\n\t\t}\r\n\t\tif (toggleIndex !== undefined) {\r\n\t\t\tpointCode = \u0060t${toggleIndex}\u0060;\r\n\t\t}\r\n\t\tif (instanceIndex !== undefined) {\r\n\t\t\tpointCode = \u0060i${instanceIndex}\u0060;\r\n\t\t}\r\n\r\n\t\treturn \u0060${serialized}${pointCode}\u0060;\r\n\t}, \u0027\u0027);\r\n\r\nwindow.addressJSON = serializeAddressJSON(address_raw);\r\nwindow.addressReduce = serializeAddressReduce(address_raw);\r\n\r\nwindow.deserializeAddressJSON = (address) =\u003E JSON.parse(address);\r\n\r\nwindow.deserializeAddressReduce = (serializedAddress) =\u003E {\r\n\tconst pointCodeRegex = /([cti])(\\d\u002B)/g;\r\n\tconst addressPointsMatches = serializedAddress.matchAll(pointCodeRegex);\r\n\tconst address = [...addressPointsMatches].map(([_match, pointType, index]) =\u003E {\r\n\t\tswitch (pointType) {\r\n\t\t\tcase \u0027c\u0027:\r\n\t\t\t\treturn { childrenIndex: \u002Bindex };\r\n\t\t\tcase \u0027t\u0027:\r\n\t\t\t\treturn { toggleIndex: \u002Bindex };\r\n\t\t\tcase \u0027i\u0027:\r\n\t\t\t\treturn { instanceIndex: \u002Bindex };\r\n\t\t}\r\n\t});\r\n\treturn address;\r\n};\r\n","TestCases":[{"Name":"JSON deserialize","Code":"deserializeAddressJSON(window.addressJSON)","IsDeferred":false},{"Name":"Reduce deserialize","Code":"deserializeAddressReduce(window.addressReduce)","IsDeferred":false}]}