{"ScriptPreparationCode":null,"TestCases":[{"Name":"split","Code":"const accept = \u0022text/html, application/xhtml\u002Bxml, application/xml;q=0.9, image/webp, */*;q=0.8\u0022\r\nif (accept \u0026\u0026\r\n accept.split(/[,;]/, 1)[0] === \u0022text/html\u0022\r\n) {\r\n renderPdf = false;\r\n outputContentType = \u0022text/html\u0022;\r\n} else {\r\n renderPdf = true;\r\n outputContentType = \u0022application/pdf\u0022;\r\n}\r\n\t","IsDeferred":false},{"Name":"indexof","Code":"const accept = \u0022text/html, application/xhtml\u002Bxml, application/xml;q=0.9, image/webp, */*;q=0.8\u0022\r\nconst htmlFormatPriority = accept.indexOf(\u0022text/html\u0022);\r\nconst pdfFormatPriority = accept.indexOf(\u0022application/pdf\u0022);\r\nif (htmlFormatPriority \u003C 0 \u0026\u0026 pdfFormatPriority \u003C 0) {\r\n throw \u0060Not supported defined accepted response formats: \u0022${accept}\u0022\u0060\r\n}\r\nif (pdfFormatPriority \u003C 0 || htmlFormatPrority \u003C pdfFormatPriority) {\r\n renderPdf = false;\r\n outputContentType = \u0022text/html\u0022;\r\n}\r\nelse {\r\n renderPdf = true;\r\n outputContentType = \u0022application/pdf\u0022;\r\n}","IsDeferred":false}]}