network proxy: add vitest coverage

This commit is contained in:
nick-delirium 2024-09-30 12:52:11 +02:00
parent 4996210959
commit cac0f3edc0
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
20 changed files with 6711 additions and 4 deletions

View file

@ -0,0 +1,224 @@
body, html {
margin:0; padding: 0;
height: 100%;
}
body {
font-family: Helvetica Neue, Helvetica, Arial;
font-size: 14px;
color:#333;
}
.small { font-size: 12px; }
*, *:after, *:before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
h1 { font-size: 20px; margin: 0;}
h2 { font-size: 14px; }
pre {
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
margin: 0;
padding: 0;
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
}
a { color:#0074D9; text-decoration:none; }
a:hover { text-decoration:underline; }
.strong { font-weight: bold; }
.space-top1 { padding: 10px 0 0 0; }
.pad2y { padding: 20px 0; }
.pad1y { padding: 10px 0; }
.pad2x { padding: 0 20px; }
.pad2 { padding: 20px; }
.pad1 { padding: 10px; }
.space-left2 { padding-left:55px; }
.space-right2 { padding-right:20px; }
.center { text-align:center; }
.clearfix { display:block; }
.clearfix:after {
content:'';
display:block;
height:0;
clear:both;
visibility:hidden;
}
.fl { float: left; }
@media only screen and (max-width:640px) {
.col3 { width:100%; max-width:100%; }
.hide-mobile { display:none!important; }
}
.quiet {
color: #7f7f7f;
color: rgba(0,0,0,0.5);
}
.quiet a { opacity: 0.7; }
.fraction {
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
font-size: 10px;
color: #555;
background: #E8E8E8;
padding: 4px 5px;
border-radius: 3px;
vertical-align: middle;
}
div.path a:link, div.path a:visited { color: #333; }
table.coverage {
border-collapse: collapse;
margin: 10px 0 0 0;
padding: 0;
}
table.coverage td {
margin: 0;
padding: 0;
vertical-align: top;
}
table.coverage td.line-count {
text-align: right;
padding: 0 5px 0 20px;
}
table.coverage td.line-coverage {
text-align: right;
padding-right: 10px;
min-width:20px;
}
table.coverage td span.cline-any {
display: inline-block;
padding: 0 5px;
width: 100%;
}
.missing-if-branch {
display: inline-block;
margin-right: 5px;
border-radius: 3px;
position: relative;
padding: 0 4px;
background: #333;
color: yellow;
}
.skip-if-branch {
display: none;
margin-right: 10px;
position: relative;
padding: 0 4px;
background: #ccc;
color: white;
}
.missing-if-branch .typ, .skip-if-branch .typ {
color: inherit !important;
}
.coverage-summary {
border-collapse: collapse;
width: 100%;
}
.coverage-summary tr { border-bottom: 1px solid #bbb; }
.keyline-all { border: 1px solid #ddd; }
.coverage-summary td, .coverage-summary th { padding: 10px; }
.coverage-summary tbody { border: 1px solid #bbb; }
.coverage-summary td { border-right: 1px solid #bbb; }
.coverage-summary td:last-child { border-right: none; }
.coverage-summary th {
text-align: left;
font-weight: normal;
white-space: nowrap;
}
.coverage-summary th.file { border-right: none !important; }
.coverage-summary th.pct { }
.coverage-summary th.pic,
.coverage-summary th.abs,
.coverage-summary td.pct,
.coverage-summary td.abs { text-align: right; }
.coverage-summary td.file { white-space: nowrap; }
.coverage-summary td.pic { min-width: 120px !important; }
.coverage-summary tfoot td { }
.coverage-summary .sorter {
height: 10px;
width: 7px;
display: inline-block;
margin-left: 0.5em;
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
}
.coverage-summary .sorted .sorter {
background-position: 0 -20px;
}
.coverage-summary .sorted-desc .sorter {
background-position: 0 -10px;
}
.status-line { height: 10px; }
/* yellow */
.cbranch-no { background: yellow !important; color: #111; }
/* dark red */
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
.low .chart { border:1px solid #C21F39 }
.highlighted,
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
background: #C21F39 !important;
}
/* medium red */
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
/* light red */
.low, .cline-no { background:#FCE1E5 }
/* light green */
.high, .cline-yes { background:rgb(230,245,208) }
/* medium green */
.cstat-yes { background:rgb(161,215,106) }
/* dark green */
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
.high .chart { border:1px solid rgb(77,146,33) }
/* dark yellow (gold) */
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
.medium .chart { border:1px solid #f9cd0b; }
/* light yellow */
.medium { background: #fff4c2; }
.cstat-skip { background: #ddd; color: #111; }
.fstat-skip { background: #ddd; color: #111 !important; }
.cbranch-skip { background: #ddd !important; color: #111; }
span.cline-neutral { background: #eaeaea; }
.coverage-summary td.empty {
opacity: .5;
padding-top: 4px;
padding-bottom: 4px;
line-height: 1;
color: #888;
}
.cover-fill, .cover-empty {
display:inline-block;
height: 12px;
}
.chart {
line-height: 0;
}
.cover-empty {
background: white;
}
.cover-full {
border-right: none !important;
}
pre.prettyprint {
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
.com { color: #999 !important; }
.ignore-none { color: #999; font-weight: normal; }
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -48px;
}
.footer, .push {
height: 48px;
}

View file

@ -0,0 +1,397 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for beaconProxy.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> beaconProxy.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/51</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/24</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/5</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/51</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import NetworkMessage from './networkMessage'
import { RequestState, INetworkMessage, RequestResponseData } from './types';
import { genStringBody, getURL } from './utils'
&nbsp;
// https://fetch.spec.whatwg.org/#concept-bodyinit-extract
const getContentType = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(d</span>ata?: BodyInit) =&gt; {</span>
<span class="cstat-no" title="statement not covered" > if (data instanceof Blob) {</span>
<span class="cstat-no" title="statement not covered" > return data.type</span>
}
<span class="cstat-no" title="statement not covered" > if (data instanceof FormData) {</span>
<span class="cstat-no" title="statement not covered" > return 'multipart/form-data'</span>
}
<span class="cstat-no" title="statement not covered" > if (data instanceof URLSearchParams) {</span>
<span class="cstat-no" title="statement not covered" > return 'application/x-www-form-urlencoded;charset=UTF-8'</span>
}
<span class="cstat-no" title="statement not covered" > return 'text/plain;charset=UTF-8'</span>
}
&nbsp;
export class BeaconProxyHandler&lt;T extends typeof navigator.sendBeacon&gt; implements ProxyHandler&lt;T&gt; {
<span class="fstat-no" title="function not covered" > constructor(</span>
private readonly <span class="cstat-no" title="statement not covered" >ignoredHeaders: boolean | string[],</span>
private readonly <span class="cstat-no" title="statement not covered" >setSessionTokenHeader: (cb: (name: string, value: string) =&gt; void) =&gt; void,</span>
private readonly <span class="cstat-no" title="statement not covered" >sanitize: (data: RequestResponseData) =&gt; RequestResponseData | null,</span>
private readonly <span class="cstat-no" title="statement not covered" >sendMessage: (item: INetworkMessage) =&gt; void,</span>
private readonly <span class="cstat-no" title="statement not covered" >isServiceUrl: (url: string) =&gt; boolean,</span>
) {}
&nbsp;
public <span class="fstat-no" title="function not covered" >apply(t</span>arget: T, thisArg: T, argsList: any[]) {
const urlString: string = <span class="cstat-no" title="statement not covered" >argsList[0]</span>
const data: BodyInit = <span class="cstat-no" title="statement not covered" >argsList[1]</span>
const item = <span class="cstat-no" title="statement not covered" >new NetworkMessage(this.ignoredHeaders, this.setSessionTokenHeader, this.sanitize)</span>
<span class="cstat-no" title="statement not covered" > if (this.isServiceUrl(urlString)) {</span>
<span class="cstat-no" title="statement not covered" > return target.apply(thisArg, argsList)</span>
}
const url = <span class="cstat-no" title="statement not covered" >getURL(urlString)</span>
<span class="cstat-no" title="statement not covered" > item.method = 'POST'</span>
<span class="cstat-no" title="statement not covered" > item.url = urlString</span>
<span class="cstat-no" title="statement not covered" > item.name = (url.pathname.split('/').pop() || '') + url.search</span>
<span class="cstat-no" title="statement not covered" > item.requestType = 'beacon'</span>
<span class="cstat-no" title="statement not covered" > item.requestHeader = { 'Content-Type': getContentType(data) }</span>
<span class="cstat-no" title="statement not covered" > item.status = 0</span>
<span class="cstat-no" title="statement not covered" > item.statusText = 'Pending'</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > if (url.search &amp;&amp; url.searchParams) {</span>
<span class="cstat-no" title="statement not covered" > item.getData = {}</span>
<span class="cstat-no" title="statement not covered" > for (const [key, value] of url.searchParams) {</span>
<span class="cstat-no" title="statement not covered" > item.getData[key] = value</span>
}
}
<span class="cstat-no" title="statement not covered" > item.requestData = genStringBody(data)</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > if (!item.startTime) {</span>
<span class="cstat-no" title="statement not covered" > item.startTime = performance.now()</span>
}
&nbsp;
const isSuccess = <span class="cstat-no" title="statement not covered" >target.apply(thisArg, argsList)</span>
<span class="cstat-no" title="statement not covered" > if (isSuccess) {</span>
<span class="cstat-no" title="statement not covered" > item.endTime = performance.now()</span>
<span class="cstat-no" title="statement not covered" > item.duration = item.endTime - (item.startTime || item.endTime)</span>
<span class="cstat-no" title="statement not covered" > item.status = 0</span>
<span class="cstat-no" title="statement not covered" > item.statusText = 'Sent'</span>
<span class="cstat-no" title="statement not covered" > item.readyState = 4</span>
} else {
<span class="cstat-no" title="statement not covered" > item.status = 500</span>
<span class="cstat-no" title="statement not covered" > item.statusText = 'Unknown'</span>
}
&nbsp;
const msg = <span class="cstat-no" title="statement not covered" >item.getMessage()</span>
<span class="cstat-no" title="statement not covered" > if (msg) {</span>
<span class="cstat-no" title="statement not covered" > this.sendMessage(msg)</span>
}
<span class="cstat-no" title="statement not covered" > return isSuccess</span>
}
}
&nbsp;
export default class BeaconProxy {
<span class="cstat-no" title="statement not covered" > public static origSendBeacon = window?.navigator?.sendBeacon</span>
&nbsp;
<span class="fstat-no" title="function not covered" > public static h</span>asSendBeacon() {
<span class="cstat-no" title="statement not covered" > return !!BeaconProxy.origSendBeacon</span>
}
&nbsp;
<span class="fstat-no" title="function not covered" > public static c</span>reate(
ignoredHeaders: boolean | string[],
setSessionTokenHeader: (cb: (name: string, value: string) =&gt; void) =&gt; void,
sanitize: (data: RequestResponseData) =&gt; RequestResponseData | null,
sendMessage: (item: INetworkMessage) =&gt; void,
isServiceUrl: (url: string) =&gt; boolean,
) {
<span class="cstat-no" title="statement not covered" > if (!BeaconProxy.hasSendBeacon()) {</span>
<span class="cstat-no" title="statement not covered" > return undefined</span>
}
<span class="cstat-no" title="statement not covered" > return new Proxy(</span>
BeaconProxy.origSendBeacon,
new BeaconProxyHandler(
ignoredHeaders,
setSessionTokenHeader,
sanitize,
sendMessage,
isServiceUrl,
),
)
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-09-30T10:51:43.373Z
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,87 @@
/* eslint-disable */
var jumpToCode = (function init() {
// Classes of code we would like to highlight in the file view
var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
// Elements to highlight in the file listing view
var fileListingElements = ['td.pct.low'];
// We don't want to select elements that are direct descendants of another match
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
// Selecter that finds elements on the page to which we can jump
var selector =
fileListingElements.join(', ') +
', ' +
notSelector +
missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
// The NodeList of matching elements
var missingCoverageElements = document.querySelectorAll(selector);
var currentIndex;
function toggleClass(index) {
missingCoverageElements
.item(currentIndex)
.classList.remove('highlighted');
missingCoverageElements.item(index).classList.add('highlighted');
}
function makeCurrent(index) {
toggleClass(index);
currentIndex = index;
missingCoverageElements.item(index).scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'center'
});
}
function goToPrevious() {
var nextIndex = 0;
if (typeof currentIndex !== 'number' || currentIndex === 0) {
nextIndex = missingCoverageElements.length - 1;
} else if (missingCoverageElements.length > 1) {
nextIndex = currentIndex - 1;
}
makeCurrent(nextIndex);
}
function goToNext() {
var nextIndex = 0;
if (
typeof currentIndex === 'number' &&
currentIndex < missingCoverageElements.length - 1
) {
nextIndex = currentIndex + 1;
}
makeCurrent(nextIndex);
}
return function jump(event) {
if (
document.getElementById('fileSearch') === document.activeElement &&
document.activeElement != null
) {
// if we're currently focused on the search input, we don't want to navigate
return;
}
switch (event.which) {
case 78: // n
case 74: // j
goToNext();
break;
case 66: // b
case 75: // k
case 80: // p
goToPrevious();
break;
}
};
})();
window.addEventListener('keydown', jumpToCode);

View file

@ -0,0 +1,521 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1727693503380" clover="3.2.0">
<project timestamp="1727693503381" name="All files">
<metrics statements="494" coveredstatements="129" conditionals="311" coveredconditionals="70" methods="72" coveredmethods="16" elements="877" coveredelements="215" complexity="0" loc="494" ncloc="494" packages="1" files="7" classes="7"/>
<file name="beaconProxy.ts" path="/Users/nikitamelnikov/Documents/work/openreplay/networkProxy/src/beaconProxy.ts">
<metrics statements="51" coveredstatements="0" conditionals="24" coveredconditionals="0" methods="5" coveredmethods="0"/>
<line num="6" count="0" type="stmt"/>
<line num="7" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="8" count="0" type="stmt"/>
<line num="10" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="11" count="0" type="stmt"/>
<line num="13" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="14" count="0" type="stmt"/>
<line num="16" count="0" type="stmt"/>
<line num="21" count="0" type="stmt"/>
<line num="22" count="0" type="stmt"/>
<line num="23" count="0" type="stmt"/>
<line num="24" count="0" type="stmt"/>
<line num="25" count="0" type="stmt"/>
<line num="29" count="0" type="stmt"/>
<line num="30" count="0" type="stmt"/>
<line num="31" count="0" type="stmt"/>
<line num="32" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="33" count="0" type="stmt"/>
<line num="35" count="0" type="stmt"/>
<line num="36" count="0" type="stmt"/>
<line num="37" count="0" type="stmt"/>
<line num="38" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="39" count="0" type="stmt"/>
<line num="40" count="0" type="stmt"/>
<line num="41" count="0" type="stmt"/>
<line num="42" count="0" type="stmt"/>
<line num="44" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="45" count="0" type="stmt"/>
<line num="46" count="0" type="stmt"/>
<line num="47" count="0" type="stmt"/>
<line num="50" count="0" type="stmt"/>
<line num="52" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="53" count="0" type="stmt"/>
<line num="56" count="0" type="stmt"/>
<line num="57" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="58" count="0" type="stmt"/>
<line num="59" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="60" count="0" type="stmt"/>
<line num="61" count="0" type="stmt"/>
<line num="62" count="0" type="stmt"/>
<line num="64" count="0" type="stmt"/>
<line num="65" count="0" type="stmt"/>
<line num="68" count="0" type="stmt"/>
<line num="69" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="70" count="0" type="stmt"/>
<line num="72" count="0" type="stmt"/>
<line num="77" count="0" type="stmt"/>
<line num="80" count="0" type="stmt"/>
<line num="90" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="91" count="0" type="stmt"/>
<line num="93" count="0" type="stmt"/>
</file>
<file name="fetchProxy.ts" path="/Users/nikitamelnikov/Documents/work/openreplay/networkProxy/src/fetchProxy.ts">
<metrics statements="147" coveredstatements="0" conditionals="95" coveredconditionals="0" methods="21" coveredmethods="0"/>
<line num="17" count="0" type="stmt"/>
<line num="18" count="0" type="stmt"/>
<line num="19" count="0" type="stmt"/>
<line num="23" count="0" type="stmt"/>
<line num="27" count="0" type="stmt"/>
<line num="28" count="0" type="cond" truecount="0" falsecount="5"/>
<line num="34" count="0" type="stmt"/>
<line num="35" count="0" type="stmt"/>
<line num="37" count="0" type="stmt"/>
<line num="38" count="0" type="stmt"/>
<line num="39" count="0" type="stmt"/>
<line num="43" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="44" count="0" type="stmt"/>
<line num="46" count="0" type="stmt"/>
<line num="52" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="54" count="0" type="stmt"/>
<line num="56" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="57" count="0" type="stmt"/>
<line num="59" count="0" type="stmt"/>
<line num="61" count="0" type="stmt"/>
<line num="62" count="0" type="stmt"/>
<line num="67" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="68" count="0" type="stmt"/>
<line num="71" count="0" type="stmt"/>
<line num="72" count="0" type="stmt"/>
<line num="73" count="0" type="stmt"/>
<line num="76" count="0" type="stmt"/>
<line num="77" count="0" type="stmt"/>
<line num="79" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="81" count="0" type="stmt"/>
<line num="84" count="0" type="stmt"/>
<line num="85" count="0" type="stmt"/>
<line num="87" count="0" type="stmt"/>
<line num="88" count="0" type="stmt"/>
<line num="90" count="0" type="stmt"/>
<line num="91" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="92" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="93" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="94" count="0" type="stmt"/>
<line num="95" count="0" type="stmt"/>
<line num="96" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="97" count="0" type="stmt"/>
<line num="102" count="0" type="stmt"/>
<line num="107" count="0" type="stmt"/>
<line num="108" count="0" type="stmt"/>
<line num="109" count="0" type="stmt"/>
<line num="110" count="0" type="stmt"/>
<line num="111" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="112" count="0" type="stmt"/>
<line num="113" count="0" type="stmt"/>
<line num="115" count="0" type="stmt"/>
<line num="122" count="0" type="stmt"/>
<line num="123" count="0" type="stmt"/>
<line num="124" count="0" type="stmt"/>
<line num="125" count="0" type="stmt"/>
<line num="126" count="0" type="stmt"/>
<line num="127" count="0" type="stmt"/>
<line num="131" count="0" type="stmt"/>
<line num="132" count="0" type="stmt"/>
<line num="133" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="138" count="0" type="stmt"/>
<line num="142" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="146" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="147" count="0" type="stmt"/>
<line num="150" count="0" type="stmt"/>
<line num="151" count="0" type="stmt"/>
<line num="153" count="0" type="stmt"/>
<line num="154" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="155" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="156" count="0" type="stmt"/>
<line num="159" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="160" count="0" type="stmt"/>
<line num="162" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="163" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="164" count="0" type="stmt"/>
<line num="166" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="167" count="0" type="stmt"/>
<line num="168" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="169" count="0" type="stmt"/>
<line num="172" count="0" type="stmt"/>
<line num="176" count="0" type="stmt"/>
<line num="180" count="0" type="stmt"/>
<line num="181" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="182" count="0" type="stmt"/>
<line num="188" count="0" type="stmt"/>
<line num="189" count="0" type="stmt"/>
<line num="192" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="194" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="195" count="0" type="stmt"/>
<line num="196" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="199" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="200" count="0" type="stmt"/>
<line num="201" count="0" type="stmt"/>
<line num="204" count="0" type="stmt"/>
<line num="205" count="0" type="stmt"/>
<line num="206" count="0" type="stmt"/>
<line num="207" count="0" type="stmt"/>
<line num="208" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="209" count="0" type="stmt"/>
<line num="210" count="0" type="stmt"/>
<line num="211" count="0" type="stmt"/>
<line num="212" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="214" count="0" type="stmt"/>
<line num="217" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="218" count="0" type="stmt"/>
<line num="219" count="0" type="stmt"/>
<line num="220" count="0" type="stmt"/>
<line num="223" count="0" type="stmt"/>
<line num="227" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="228" count="0" type="stmt"/>
<line num="229" count="0" type="stmt"/>
<line num="230" count="0" type="stmt"/>
<line num="235" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="236" count="0" type="stmt"/>
<line num="241" count="0" type="stmt"/>
<line num="242" count="0" type="stmt"/>
<line num="243" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="244" count="0" type="stmt"/>
<line num="245" count="0" type="stmt"/>
<line num="247" count="0" type="stmt"/>
<line num="248" count="0" type="stmt"/>
<line num="249" count="0" type="stmt"/>
<line num="250" count="0" type="stmt"/>
<line num="251" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="254" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="258" count="0" type="stmt"/>
<line num="262" count="0" type="stmt"/>
<line num="264" count="0" type="stmt"/>
<line num="266" count="0" type="stmt"/>
<line num="268" count="0" type="stmt"/>
<line num="269" count="0" type="stmt"/>
<line num="271" count="0" type="stmt"/>
<line num="272" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="273" count="0" type="stmt"/>
<line num="277" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="278" count="0" type="stmt"/>
<line num="285" count="0" type="stmt"/>
<line num="291" count="0" type="stmt"/>
<line num="292" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="293" count="0" type="stmt"/>
<line num="294" count="0" type="stmt"/>
<line num="295" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="299" count="0" type="stmt"/>
<line num="300" count="0" type="stmt"/>
<line num="302" count="0" type="stmt"/>
<line num="303" count="0" type="stmt"/>
<line num="317" count="0" type="stmt"/>
</file>
<file name="index.ts" path="/Users/nikitamelnikov/Documents/work/openreplay/networkProxy/src/index.ts">
<metrics statements="14" coveredstatements="0" conditionals="13" coveredconditionals="0" methods="2" coveredmethods="0"/>
<line num="14" count="0" type="stmt"/>
<line num="15" count="0" type="stmt"/>
<line num="16" count="0" type="stmt"/>
<line num="57" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="58" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="59" count="0" type="stmt"/>
<line num="68" count="0" type="stmt"/>
<line num="71" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="72" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="73" count="0" type="stmt"/>
<line num="82" count="0" type="stmt"/>
<line num="85" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="86" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="87" count="0" type="stmt"/>
</file>
<file name="networkMessage.ts" path="/Users/nikitamelnikov/Documents/work/openreplay/networkProxy/src/networkMessage.ts">
<metrics statements="47" coveredstatements="43" conditionals="18" coveredconditionals="10" methods="8" coveredmethods="7"/>
<line num="13" count="4" type="stmt"/>
<line num="14" count="4" type="stmt"/>
<line num="15" count="4" type="stmt"/>
<line num="16" count="4" type="stmt"/>
<line num="17" count="4" type="stmt"/>
<line num="18" count="4" type="stmt"/>
<line num="19" count="4" type="stmt"/>
<line num="20" count="4" type="stmt"/>
<line num="21" count="4" type="stmt"/>
<line num="22" count="4" type="stmt"/>
<line num="23" count="4" type="stmt"/>
<line num="24" count="4" type="stmt"/>
<line num="26" count="4" type="stmt"/>
<line num="27" count="4" type="stmt"/>
<line num="28" count="4" type="stmt"/>
<line num="29" count="4" type="stmt"/>
<line num="30" count="4" type="stmt"/>
<line num="31" count="4" type="stmt"/>
<line num="32" count="4" type="stmt"/>
<line num="35" count="4" type="cond" truecount="0" falsecount="1"/>
<line num="36" count="4" type="stmt"/>
<line num="37" count="4" type="stmt"/>
<line num="41" count="1" type="stmt"/>
<line num="42" count="1" type="stmt"/>
<line num="46" count="1" type="stmt"/>
<line num="48" count="1" type="stmt"/>
<line num="56" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="58" count="1" type="stmt"/>
<line num="59" count="1" type="cond" truecount="2" falsecount="3"/>
<line num="60" count="0" type="stmt"/>
<line num="61" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="62" count="0" type="stmt"/>
<line num="65" count="1" type="stmt"/>
<line num="79" count="2" type="stmt"/>
<line num="80" count="2" type="stmt"/>
<line num="81" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="82" count="1" type="stmt"/>
<line num="84" count="2" type="stmt"/>
<line num="85" count="0" type="stmt"/>
<line num="87" count="2" type="stmt"/>
<line num="88" count="2" type="stmt"/>
<line num="89" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="90" count="1" type="stmt"/>
<line num="92" count="2" type="stmt"/>
<line num="96" count="9" type="cond" truecount="2" falsecount="0"/>
<line num="97" count="6" type="stmt"/>
<line num="99" count="3" type="stmt"/>
</file>
<file name="types.ts" path="/Users/nikitamelnikov/Documents/work/openreplay/networkProxy/src/types.ts">
<metrics statements="6" coveredstatements="0" conditionals="2" coveredconditionals="0" methods="1" coveredmethods="0"/>
<line num="33" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="34" count="0" type="stmt"/>
<line num="35" count="0" type="stmt"/>
<line num="36" count="0" type="stmt"/>
<line num="37" count="0" type="stmt"/>
<line num="38" count="0" type="stmt"/>
</file>
<file name="utils.ts" path="/Users/nikitamelnikov/Documents/work/openreplay/networkProxy/src/utils.ts">
<metrics statements="105" coveredstatements="86" conditionals="100" coveredconditionals="60" methods="9" coveredmethods="9"/>
<line num="1" count="1" type="stmt"/>
<line num="5" count="2" type="stmt"/>
<line num="6" count="2" type="cond" truecount="5" falsecount="2"/>
<line num="10" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="11" count="1" type="stmt"/>
<line num="12" count="1" type="stmt"/>
<line num="15" count="0" type="stmt"/>
<line num="17" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="18" count="0" type="stmt"/>
<line num="19" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="20" count="0" type="stmt"/>
<line num="22" count="1" type="stmt"/>
<line num="28" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="29" count="1" type="stmt"/>
<line num="31" count="1" type="stmt"/>
<line num="33" count="2" type="stmt"/>
<line num="36" count="1" type="stmt"/>
<line num="40" count="3" type="stmt"/>
<line num="41" count="3" type="cond" truecount="5" falsecount="2"/>
<line num="45" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="46" count="1" type="stmt"/>
<line num="47" count="1" type="cond" truecount="2" falsecount="2"/>
<line num="48" count="1" type="stmt"/>
<line num="49" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="50" count="0" type="stmt"/>
<line num="52" count="2" type="stmt"/>
<line num="57" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="58" count="1" type="stmt"/>
<line num="60" count="1" type="stmt"/>
<line num="62" count="3" type="stmt"/>
<line num="65" count="1" type="stmt"/>
<line num="66" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="67" count="0" type="stmt"/>
<line num="71" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="72" count="1" type="cond" truecount="2" falsecount="2"/>
<line num="73" count="1" type="stmt"/>
<line num="76" count="1" type="stmt"/>
<line num="77" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="79" count="1" type="stmt"/>
<line num="82" count="0" type="stmt"/>
<line num="84" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="86" count="1" type="stmt"/>
<line num="87" count="1" type="stmt"/>
<line num="88" count="1" type="cond" truecount="1" falsecount="1"/>
<line num="90" count="1" type="stmt"/>
<line num="91" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="96" count="0" type="stmt"/>
<line num="97" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="99" count="0" type="stmt"/>
<line num="101" count="0" type="stmt"/>
<line num="103" count="2" type="stmt"/>
<line num="106" count="1" type="cond" truecount="1" falsecount="0"/>
<line num="107" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="108" count="1" type="stmt"/>
<line num="110" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="111" count="2" type="stmt"/>
<line num="112" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="113" count="2" type="stmt"/>
<line num="114" count="2" type="stmt"/>
<line num="115" count="2" type="stmt"/>
<line num="116" count="2" type="stmt"/>
<line num="117" count="2" type="stmt"/>
<line num="122" count="0" type="stmt"/>
<line num="126" count="2" type="stmt"/>
<line num="129" count="1" type="stmt"/>
<line num="130" count="6" type="cond" truecount="1" falsecount="1"/>
<line num="131" count="0" type="stmt"/>
<line num="135" count="6" type="cond" truecount="2" falsecount="0"/>
<line num="136" count="2" type="stmt"/>
<line num="138" count="2" type="stmt"/>
<line num="141" count="1" type="stmt"/>
<line num="142" count="1" type="stmt"/>
<line num="144" count="1" type="stmt"/>
<line num="145" count="2" type="stmt"/>
<line num="146" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="149" count="4" type="cond" truecount="2" falsecount="0"/>
<line num="151" count="1" type="stmt"/>
<line num="152" count="1" type="stmt"/>
<line num="153" count="2" type="cond" truecount="1" falsecount="1"/>
<line num="155" count="3" type="cond" truecount="1" falsecount="1"/>
<line num="161" count="3" type="stmt"/>
<line num="162" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="163" count="0" type="stmt"/>
<line num="165" count="0" type="stmt"/>
<line num="167" count="6" type="stmt"/>
<line num="171" count="7" type="cond" truecount="2" falsecount="0"/>
<line num="175" count="9" type="cond" truecount="4" falsecount="0"/>
<line num="176" count="1" type="stmt"/>
<line num="178" count="8" type="cond" truecount="2" falsecount="0"/>
<line num="179" count="2" type="stmt"/>
<line num="181" count="6" type="cond" truecount="2" falsecount="0"/>
<line num="185" count="4" type="cond" truecount="2" falsecount="0"/>
<line num="187" count="1" type="stmt"/>
<line num="189" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="190" count="1" type="stmt"/>
<line num="192" count="2" type="cond" truecount="2" falsecount="0"/>
<line num="193" count="1" type="stmt"/>
<line num="195" count="1" type="stmt"/>
<line num="198" count="1" type="stmt"/>
<line num="199" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="200" count="1" type="stmt"/>
<line num="201" count="1" type="stmt"/>
<line num="203" count="3" type="cond" truecount="2" falsecount="0"/>
<line num="204" count="2" type="stmt"/>
<line num="206" count="1" type="stmt"/>
</file>
<file name="xhrProxy.ts" path="/Users/nikitamelnikov/Documents/work/openreplay/networkProxy/src/xhrProxy.ts">
<metrics statements="124" coveredstatements="0" conditionals="59" coveredconditionals="0" methods="26" coveredmethods="0"/>
<line num="19" count="0" type="stmt"/>
<line num="20" count="0" type="stmt"/>
<line num="21" count="0" type="stmt"/>
<line num="22" count="0" type="stmt"/>
<line num="23" count="0" type="stmt"/>
<line num="24" count="0" type="stmt"/>
<line num="26" count="0" type="stmt"/>
<line num="27" count="0" type="stmt"/>
<line num="28" count="0" type="stmt"/>
<line num="30" count="0" type="stmt"/>
<line num="31" count="0" type="stmt"/>
<line num="33" count="0" type="stmt"/>
<line num="34" count="0" type="stmt"/>
<line num="36" count="0" type="stmt"/>
<line num="37" count="0" type="stmt"/>
<line num="41" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="43" count="0" type="stmt"/>
<line num="45" count="0" type="stmt"/>
<line num="46" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="47" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="48" count="0" type="stmt"/>
<line num="51" count="0" type="stmt"/>
<line num="53" count="0" type="stmt"/>
<line num="55" count="0" type="stmt"/>
<line num="58" count="0" type="stmt"/>
<line num="59" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="60" count="0" type="stmt"/>
<line num="62" count="0" type="stmt"/>
<line num="68" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="70" count="0" type="stmt"/>
<line num="72" count="0" type="stmt"/>
<line num="74" count="0" type="stmt"/>
<line num="78" count="0" type="stmt"/>
<line num="82" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="83" count="0" type="stmt"/>
<line num="84" count="0" type="stmt"/>
<line num="85" count="0" type="stmt"/>
<line num="86" count="0" type="stmt"/>
<line num="87" count="0" type="stmt"/>
<line num="88" count="0" type="stmt"/>
<line num="89" count="0" type="stmt"/>
<line num="92" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="93" count="0" type="stmt"/>
<line num="94" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="95" count="0" type="stmt"/>
<line num="101" count="0" type="stmt"/>
<line num="102" count="0" type="stmt"/>
<line num="104" count="0" type="stmt"/>
<line num="105" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="106" count="0" type="stmt"/>
<line num="111" count="0" type="stmt"/>
<line num="112" count="0" type="stmt"/>
<line num="114" count="0" type="stmt"/>
<line num="115" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="116" count="0" type="stmt"/>
<line num="121" count="0" type="stmt"/>
<line num="122" count="0" type="stmt"/>
<line num="123" count="0" type="stmt"/>
<line num="124" count="0" type="stmt"/>
<line num="125" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="126" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="127" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="128" count="0" type="stmt"/>
<line num="129" count="0" type="stmt"/>
<line num="134" count="0" type="stmt"/>
<line num="135" count="0" type="stmt"/>
<line num="136" count="0" type="stmt"/>
<line num="137" count="0" type="stmt"/>
<line num="138" count="0" type="stmt"/>
<line num="143" count="0" type="stmt"/>
<line num="144" count="0" type="stmt"/>
<line num="145" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="146" count="0" type="stmt"/>
<line num="149" count="0" type="stmt"/>
<line num="150" count="0" type="stmt"/>
<line num="155" count="0" type="stmt"/>
<line num="156" count="0" type="stmt"/>
<line num="157" count="0" type="stmt"/>
<line num="162" count="0" type="stmt"/>
<line num="163" count="0" type="stmt"/>
<line num="164" count="0" type="stmt"/>
<line num="169" count="0" type="stmt"/>
<line num="170" count="0" type="stmt"/>
<line num="171" count="0" type="stmt"/>
<line num="179" count="0" type="cond" truecount="0" falsecount="6"/>
<line num="182" count="0" type="stmt"/>
<line num="183" count="0" type="stmt"/>
<line num="184" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="185" count="0" type="stmt"/>
<line num="187" count="0" type="stmt"/>
<line num="189" count="0" type="stmt"/>
<line num="190" count="0" type="stmt"/>
<line num="191" count="0" type="stmt"/>
<line num="193" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="194" count="0" type="stmt"/>
<line num="196" count="0" type="stmt"/>
<line num="197" count="0" type="stmt"/>
<line num="198" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="199" count="0" type="stmt"/>
<line num="201" count="0" type="stmt"/>
<line num="202" count="0" type="stmt"/>
<line num="203" count="0" type="stmt"/>
<line num="205" count="0" type="stmt"/>
<line num="207" count="0" type="stmt"/>
<line num="208" count="0" type="stmt"/>
<line num="209" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="210" count="0" type="stmt"/>
<line num="211" count="0" type="stmt"/>
<line num="213" count="0" type="stmt"/>
<line num="216" count="0" type="cond" truecount="0" falsecount="3"/>
<line num="218" count="0" type="stmt"/>
<line num="219" count="0" type="stmt"/>
<line num="220" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="221" count="0" type="stmt"/>
<line num="223" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="224" count="0" type="stmt"/>
<line num="225" count="0" type="stmt"/>
<line num="227" count="0" type="stmt"/>
<line num="229" count="0" type="stmt"/>
<line num="230" count="0" type="stmt"/>
<line num="231" count="0" type="stmt"/>
<line num="245" count="0" type="stmt"/>
<line num="247" count="0" type="stmt"/>
<line num="248" count="0" type="stmt"/>
</file>
</project>
</coverage>

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,206 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for All files</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>All files</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">26.29% </span>
<span class="quiet">Statements</span>
<span class='fraction'>132/502</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">22.5% </span>
<span class="quiet">Branches</span>
<span class='fraction'>70/311</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">22.22% </span>
<span class="quiet">Functions</span>
<span class='fraction'>16/72</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">26.11% </span>
<span class="quiet">Lines</span>
<span class='fraction'>129/494</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line low'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file low" data-value="beaconProxy.ts"><a href="beaconProxy.ts.html">beaconProxy.ts</a></td>
<td data-value="0" class="pic low">
<div class="chart"><div class="cover-fill" style="width: 0%"></div><div class="cover-empty" style="width: 100%"></div></div>
</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="51" class="abs low">0/51</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="24" class="abs low">0/24</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="5" class="abs low">0/5</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="51" class="abs low">0/51</td>
</tr>
<tr>
<td class="file low" data-value="fetchProxy.ts"><a href="fetchProxy.ts.html">fetchProxy.ts</a></td>
<td data-value="0" class="pic low">
<div class="chart"><div class="cover-fill" style="width: 0%"></div><div class="cover-empty" style="width: 100%"></div></div>
</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="148" class="abs low">0/148</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="95" class="abs low">0/95</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="21" class="abs low">0/21</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="147" class="abs low">0/147</td>
</tr>
<tr>
<td class="file low" data-value="index.ts"><a href="index.ts.html">index.ts</a></td>
<td data-value="0" class="pic low">
<div class="chart"><div class="cover-fill" style="width: 0%"></div><div class="cover-empty" style="width: 100%"></div></div>
</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="14" class="abs low">0/14</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="13" class="abs low">0/13</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="2" class="abs low">0/2</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="14" class="abs low">0/14</td>
</tr>
<tr>
<td class="file high" data-value="networkMessage.ts"><a href="networkMessage.ts.html">networkMessage.ts</a></td>
<td data-value="90.19" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 90%"></div><div class="cover-empty" style="width: 10%"></div></div>
</td>
<td data-value="90.19" class="pct high">90.19%</td>
<td data-value="51" class="abs high">46/51</td>
<td data-value="55.55" class="pct medium">55.55%</td>
<td data-value="18" class="abs medium">10/18</td>
<td data-value="87.5" class="pct high">87.5%</td>
<td data-value="8" class="abs high">7/8</td>
<td data-value="91.48" class="pct high">91.48%</td>
<td data-value="47" class="abs high">43/47</td>
</tr>
<tr>
<td class="file low" data-value="types.ts"><a href="types.ts.html">types.ts</a></td>
<td data-value="0" class="pic low">
<div class="chart"><div class="cover-fill" style="width: 0%"></div><div class="cover-empty" style="width: 100%"></div></div>
</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="7" class="abs low">0/7</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="2" class="abs low">0/2</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="1" class="abs low">0/1</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="6" class="abs low">0/6</td>
</tr>
<tr>
<td class="file high" data-value="utils.ts"><a href="utils.ts.html">utils.ts</a></td>
<td data-value="81.9" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 81%"></div><div class="cover-empty" style="width: 19%"></div></div>
</td>
<td data-value="81.9" class="pct high">81.9%</td>
<td data-value="105" class="abs high">86/105</td>
<td data-value="60" class="pct medium">60%</td>
<td data-value="100" class="abs medium">60/100</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="9" class="abs high">9/9</td>
<td data-value="81.9" class="pct high">81.9%</td>
<td data-value="105" class="abs high">86/105</td>
</tr>
<tr>
<td class="file low" data-value="xhrProxy.ts"><a href="xhrProxy.ts.html">xhrProxy.ts</a></td>
<td data-value="0" class="pic low">
<div class="chart"><div class="cover-fill" style="width: 0%"></div><div class="cover-empty" style="width: 100%"></div></div>
</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="126" class="abs low">0/126</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="59" class="abs low">0/59</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="26" class="abs low">0/26</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="124" class="abs low">0/124</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-09-30T10:51:43.373Z
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,373 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for index.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> index.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/14</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/13</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/14</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import BeaconProxy from "./beaconProxy";
import FetchProxy from "./fetchProxy";
import XHRProxy from "./xhrProxy";
import { INetworkMessage, RequestResponseData } from "./types";
&nbsp;
export {
BeaconProxy,
FetchProxy,
XHRProxy,
INetworkMessage,
RequestResponseData,
};
&nbsp;
const getWarning = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(a</span>pi: string) =&gt; {</span>
const str = <span class="cstat-no" title="statement not covered" >`Openreplay: Can't find ${api} in global context.`;</span>
<span class="cstat-no" title="statement not covered" > console.warn(str);</span>
};
&nbsp;
/**
* Creates network proxies for XMLHttpRequest, fetch, and sendBeacon to intercept and monitor network requests and
* responses.
*
* @param {Window | typeof globalThis} context - The global context object (e.g., window or globalThis).
* @param {boolean | string[]} ignoredHeaders - Headers to ignore from requests. If `true`, all headers are ignored; if
* an array of strings, those header names are ignored.
* @param {(cb: (name: string, value: string) =&gt; void) =&gt; void} setSessionTokenHeader - Function to set a session token
* header; accepts a callback that sets the header name and value.
* @param {(data: RequestResponseData) =&gt; RequestResponseData | null} sanitize - Function to sanitize request and
* response data; should return sanitized data or `null` to ignore the data.
* @param {(message: INetworkMessage) =&gt; void} sendMessage - Function to send network messages for further processing
* or logging.
* @param {(url: string) =&gt; boolean} isServiceUrl - Function to determine if a URL is a service URL that should be
* ignored by the proxy.
* @param {Object} [modules] - Modules to apply the proxies to.
* @param {boolean} [modules.xhr=true] - Whether to proxy XMLHttpRequest.
* @param {boolean} [modules.fetch=true] - Whether to proxy the fetch API.
* @param {boolean} [modules.beacon=true] - Whether to proxy navigator.sendBeacon.
* @param {(url: string) =&gt; boolean} [tokenUrlMatcher] - Optional function; the session token header will only be
* applied to requests matching this function.
*
* @returns {void}
*/
export default function <span class="fstat-no" title="function not covered" >createNetworkProxy(</span>
context: typeof globalThis,
ignoredHeaders: boolean | string[],
setSessionTokenHeader: (cb: (name: string, value: string) =&gt; void) =&gt; void,
sanitize: (data: RequestResponseData) =&gt; RequestResponseData | null,
sendMessage: (message: INetworkMessage) =&gt; void,
isServiceUrl: (url: string) =&gt; boolean,
modules: { xhr: boolean; fetch: boolean; beacon: boolean } = <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
xhr: true,
fetch: true,
beacon: true,
},
tokenUrlMatcher?: (url: string) =&gt; boolean,
): void {
<span class="cstat-no" title="statement not covered" > if (modules.xhr) {</span>
<span class="cstat-no" title="statement not covered" > if (context.XMLHttpRequest) {</span>
<span class="cstat-no" title="statement not covered" > context.XMLHttpRequest = XHRProxy.create(</span>
ignoredHeaders,
setSessionTokenHeader,
sanitize,
sendMessage,
isServiceUrl,
tokenUrlMatcher,
);
} else {
<span class="cstat-no" title="statement not covered" > getWarning("XMLHttpRequest");</span>
}
}
<span class="cstat-no" title="statement not covered" > if (modules.fetch) {</span>
<span class="cstat-no" title="statement not covered" > if (context.fetch) {</span>
<span class="cstat-no" title="statement not covered" > context.fetch = FetchProxy.create(</span>
ignoredHeaders,
setSessionTokenHeader,
sanitize,
sendMessage,
isServiceUrl,
tokenUrlMatcher,
);
} else {
<span class="cstat-no" title="statement not covered" > getWarning("fetch");</span>
}
}
<span class="cstat-no" title="statement not covered" > if (modules.beacon) {</span>
<span class="cstat-no" title="statement not covered" > if (context?.navigator?.sendBeacon) {</span>
<span class="cstat-no" title="statement not covered" > context.navigator.sendBeacon = BeaconProxy.create(</span>
ignoredHeaders,
setSessionTokenHeader,
sanitize,
sendMessage,
isServiceUrl,
);
}
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-09-30T10:51:43.373Z
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,391 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for networkMessage.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> networkMessage.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">90.19% </span>
<span class="quiet">Statements</span>
<span class='fraction'>46/51</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">55.55% </span>
<span class="quiet">Branches</span>
<span class='fraction'>10/18</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">87.5% </span>
<span class="quiet">Functions</span>
<span class='fraction'>7/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">91.48% </span>
<span class="quiet">Lines</span>
<span class='fraction'>43/47</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import {
RequestResponseData,
INetworkMessage,
httpMethod,
RequestState,
} from './types'
/**
* I know we're not using most of the information from this class
* but it can be useful in the future if we will decide to display more stuff in our ui
* */
&nbsp;
export default class NetworkMessage {
id = ''
name?: string = ''
method: httpMethod = ''
url = ''
status = 0
statusText?: string = ''
cancelState?: 0 | 1 | 2 | 3 = 0
readyState?: RequestState = 0
header: { [key: string]: string } = {}
responseType: XMLHttpRequest['responseType'] = ''
requestType: 'xhr' | 'fetch' | 'ping' | 'custom' | 'beacon' | 'graphql' = 'xhr'
requestHeader: HeadersInit = {}
response: string
responseSize = 0 // bytes
responseSizeText = ''
startTime = 0
endTime = 0
duration = 0
getData: { [key: string]: string } = {}
requestData: string | null = null
&nbsp;
constructor(
private readonly ignoredHeaders: boolean | string[] = <span class="branch-0 cbranch-no" title="branch not covered" >[],</span>
private readonly setSessionTokenHeader: (cb: (name: string, value: string) =&gt; void) =&gt; void,
private readonly sanitize: (data: RequestResponseData) =&gt; RequestResponseData | null,
) {}
&nbsp;
getMessage(): INetworkMessage | null {
const { reqHs, resHs } = this.writeHeaders()
const request = {
headers: reqHs,
body: this.method === 'GET' ? JSON.stringify(this.getData) : <span class="branch-1 cbranch-no" title="branch not covered" >this.requestData,</span>
}
const response = { headers: resHs, body: this.response }
&nbsp;
const messageInfo = this.sanitize({
url: this.url,
method: this.method,
status: this.status,
request,
response,
})
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (!messageInfo) <span class="cstat-no" title="statement not covered" >return null;</span>
&nbsp;
const isGraphql = messageInfo.url.includes("/graphql");
<span class="missing-if-branch" title="if path not taken" >I</span>if (isGraphql &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >messageInfo.response.body &amp;&amp; <span class="branch-2 cbranch-no" title="branch not covered" >t</span>ypeof messageInfo.response.body === 'string') {</span>
const isError = <span class="cstat-no" title="statement not covered" >messageInfo.response.body.includes("errors");</span>
<span class="cstat-no" title="statement not covered" > messageInfo.status = isError ? 400 : 200;</span>
<span class="cstat-no" title="statement not covered" > this.requestType = 'graphql';</span>
}
&nbsp;
return {
requestType: this.requestType,
method: messageInfo.method as httpMethod,
url: messageInfo.url,
request: JSON.stringify(messageInfo.request),
response: JSON.stringify(messageInfo.response),
status: messageInfo.status,
startTime: this.startTime,
duration: this.duration,
responseSize: this.responseSize,
}
}
&nbsp;
writeHeaders() {
const reqHs: Record&lt;string, string&gt; = {}
Object.entries(this.requestHeader).forEach(([key, value]) =&gt; {
if (this.isHeaderIgnored(key)) return
reqHs[key] = value
})
this.setSessionTokenHeader(<span class="fstat-no" title="function not covered" >(n</span>ame, value) =&gt; {
<span class="cstat-no" title="statement not covered" > reqHs[name] = value</span>
})
const resHs: Record&lt;string, string&gt; = {}
Object.entries(this.header).forEach(([key, value]) =&gt; {
if (this.isHeaderIgnored(key)) return
resHs[key] = value
})
return { reqHs, resHs }
}
&nbsp;
isHeaderIgnored(key: string) {
if (Array.isArray(this.ignoredHeaders)) {
return this.ignoredHeaders.map((k) =&gt; k.toLowerCase()).includes(key.toLowerCase())
} else {
return this.ignoredHeaders
}
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-09-30T10:51:43.373Z
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1 @@
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

View file

@ -0,0 +1,196 @@
/* eslint-disable */
var addSorting = (function() {
'use strict';
var cols,
currentSort = {
index: 0,
desc: false
};
// returns the summary table element
function getTable() {
return document.querySelector('.coverage-summary');
}
// returns the thead element of the summary table
function getTableHeader() {
return getTable().querySelector('thead tr');
}
// returns the tbody element of the summary table
function getTableBody() {
return getTable().querySelector('tbody');
}
// returns the th element for nth column
function getNthColumn(n) {
return getTableHeader().querySelectorAll('th')[n];
}
function onFilterInput() {
const searchValue = document.getElementById('fileSearch').value;
const rows = document.getElementsByTagName('tbody')[0].children;
for (let i = 0; i < rows.length; i++) {
const row = rows[i];
if (
row.textContent
.toLowerCase()
.includes(searchValue.toLowerCase())
) {
row.style.display = '';
} else {
row.style.display = 'none';
}
}
}
// loads the search box
function addSearchBox() {
var template = document.getElementById('filterTemplate');
var templateClone = template.content.cloneNode(true);
templateClone.getElementById('fileSearch').oninput = onFilterInput;
template.parentElement.appendChild(templateClone);
}
// loads all columns
function loadColumns() {
var colNodes = getTableHeader().querySelectorAll('th'),
colNode,
cols = [],
col,
i;
for (i = 0; i < colNodes.length; i += 1) {
colNode = colNodes[i];
col = {
key: colNode.getAttribute('data-col'),
sortable: !colNode.getAttribute('data-nosort'),
type: colNode.getAttribute('data-type') || 'string'
};
cols.push(col);
if (col.sortable) {
col.defaultDescSort = col.type === 'number';
colNode.innerHTML =
colNode.innerHTML + '<span class="sorter"></span>';
}
}
return cols;
}
// attaches a data attribute to every tr element with an object
// of data values keyed by column name
function loadRowData(tableRow) {
var tableCols = tableRow.querySelectorAll('td'),
colNode,
col,
data = {},
i,
val;
for (i = 0; i < tableCols.length; i += 1) {
colNode = tableCols[i];
col = cols[i];
val = colNode.getAttribute('data-value');
if (col.type === 'number') {
val = Number(val);
}
data[col.key] = val;
}
return data;
}
// loads all row data
function loadData() {
var rows = getTableBody().querySelectorAll('tr'),
i;
for (i = 0; i < rows.length; i += 1) {
rows[i].data = loadRowData(rows[i]);
}
}
// sorts the table using the data for the ith column
function sortByIndex(index, desc) {
var key = cols[index].key,
sorter = function(a, b) {
a = a.data[key];
b = b.data[key];
return a < b ? -1 : a > b ? 1 : 0;
},
finalSorter = sorter,
tableBody = document.querySelector('.coverage-summary tbody'),
rowNodes = tableBody.querySelectorAll('tr'),
rows = [],
i;
if (desc) {
finalSorter = function(a, b) {
return -1 * sorter(a, b);
};
}
for (i = 0; i < rowNodes.length; i += 1) {
rows.push(rowNodes[i]);
tableBody.removeChild(rowNodes[i]);
}
rows.sort(finalSorter);
for (i = 0; i < rows.length; i += 1) {
tableBody.appendChild(rows[i]);
}
}
// removes sort indicators for current column being sorted
function removeSortIndicators() {
var col = getNthColumn(currentSort.index),
cls = col.className;
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
col.className = cls;
}
// adds sort indicators for current column being sorted
function addSortIndicators() {
getNthColumn(currentSort.index).className += currentSort.desc
? ' sorted-desc'
: ' sorted';
}
// adds event listeners for all sorter widgets
function enableUI() {
var i,
el,
ithSorter = function ithSorter(i) {
var col = cols[i];
return function() {
var desc = col.defaultDescSort;
if (currentSort.index === i) {
desc = !currentSort.desc;
}
sortByIndex(i, desc);
removeSortIndicators();
currentSort.index = i;
currentSort.desc = desc;
addSortIndicators();
};
};
for (i = 0; i < cols.length; i += 1) {
if (cols[i].sortable) {
// add the click event handler on the th so users
// dont have to click on those tiny arrows
el = getNthColumn(i).querySelector('.sorter').parentElement;
if (el.addEventListener) {
el.addEventListener('click', ithSorter(i));
} else {
el.attachEvent('onclick', ithSorter(i));
}
}
}
}
// adds sorting functionality to the UI
return function() {
if (!getTable()) {
return;
}
cols = loadColumns();
loadData();
addSearchBox();
addSortIndicators();
enableUI();
};
})();
window.addEventListener('load', addSorting);

View file

@ -0,0 +1,202 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for types.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> types.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/7</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/6</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">export interface RequestResponseData {
status: number
readonly method: string
url: string
request: {
body: string | null
headers: Record&lt;string, string&gt;
}
response: {
body: string | null
headers: Record&lt;string, string&gt;
}
}
&nbsp;
export interface INetworkMessage {
requestType: 'xhr' | 'fetch' | 'ping' | 'custom' | 'beacon' | 'graphql',
method: httpMethod,
url: string,
/** stringified JSON { headers: {}, body: {} } */
request: string,
/** stringified JSON { headers: {}, body: {} } */
response: string,
status: number,
startTime: number,
duration: number,
responseSize: number,
}
&nbsp;
export type httpMethod =
// '' is a rare case of error
'' | 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH'
&nbsp;
export <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >enum <span class="cstat-no" title="statement not covered" >R</span>equestState {</span></span>
<span class="cstat-no" title="statement not covered" > UNSENT = 0</span>,
<span class="cstat-no" title="statement not covered" > OPENED = 1</span>,
<span class="cstat-no" title="statement not covered" > HEADERS_RECEIVED = 2</span>,
<span class="cstat-no" title="statement not covered" > LOADING = 3</span>,
<span class="cstat-no" title="statement not covered" > DONE = 4</span>,
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-09-30T10:51:43.373Z
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,709 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for utils.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> utils.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">81.9% </span>
<span class="quiet">Statements</span>
<span class='fraction'>86/105</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">60% </span>
<span class="quiet">Branches</span>
<span class='fraction'>60/100</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>9/9</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">81.9% </span>
<span class="quiet">Lines</span>
<span class='fraction'>86/105</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a>
<a name='L149'></a><a href='#L149'>149</a>
<a name='L150'></a><a href='#L150'>150</a>
<a name='L151'></a><a href='#L151'>151</a>
<a name='L152'></a><a href='#L152'>152</a>
<a name='L153'></a><a href='#L153'>153</a>
<a name='L154'></a><a href='#L154'>154</a>
<a name='L155'></a><a href='#L155'>155</a>
<a name='L156'></a><a href='#L156'>156</a>
<a name='L157'></a><a href='#L157'>157</a>
<a name='L158'></a><a href='#L158'>158</a>
<a name='L159'></a><a href='#L159'>159</a>
<a name='L160'></a><a href='#L160'>160</a>
<a name='L161'></a><a href='#L161'>161</a>
<a name='L162'></a><a href='#L162'>162</a>
<a name='L163'></a><a href='#L163'>163</a>
<a name='L164'></a><a href='#L164'>164</a>
<a name='L165'></a><a href='#L165'>165</a>
<a name='L166'></a><a href='#L166'>166</a>
<a name='L167'></a><a href='#L167'>167</a>
<a name='L168'></a><a href='#L168'>168</a>
<a name='L169'></a><a href='#L169'>169</a>
<a name='L170'></a><a href='#L170'>170</a>
<a name='L171'></a><a href='#L171'>171</a>
<a name='L172'></a><a href='#L172'>172</a>
<a name='L173'></a><a href='#L173'>173</a>
<a name='L174'></a><a href='#L174'>174</a>
<a name='L175'></a><a href='#L175'>175</a>
<a name='L176'></a><a href='#L176'>176</a>
<a name='L177'></a><a href='#L177'>177</a>
<a name='L178'></a><a href='#L178'>178</a>
<a name='L179'></a><a href='#L179'>179</a>
<a name='L180'></a><a href='#L180'>180</a>
<a name='L181'></a><a href='#L181'>181</a>
<a name='L182'></a><a href='#L182'>182</a>
<a name='L183'></a><a href='#L183'>183</a>
<a name='L184'></a><a href='#L184'>184</a>
<a name='L185'></a><a href='#L185'>185</a>
<a name='L186'></a><a href='#L186'>186</a>
<a name='L187'></a><a href='#L187'>187</a>
<a name='L188'></a><a href='#L188'>188</a>
<a name='L189'></a><a href='#L189'>189</a>
<a name='L190'></a><a href='#L190'>190</a>
<a name='L191'></a><a href='#L191'>191</a>
<a name='L192'></a><a href='#L192'>192</a>
<a name='L193'></a><a href='#L193'>193</a>
<a name='L194'></a><a href='#L194'>194</a>
<a name='L195'></a><a href='#L195'>195</a>
<a name='L196'></a><a href='#L196'>196</a>
<a name='L197'></a><a href='#L197'>197</a>
<a name='L198'></a><a href='#L198'>198</a>
<a name='L199'></a><a href='#L199'>199</a>
<a name='L200'></a><a href='#L200'>200</a>
<a name='L201'></a><a href='#L201'>201</a>
<a name='L202'></a><a href='#L202'>202</a>
<a name='L203'></a><a href='#L203'>203</a>
<a name='L204'></a><a href='#L204'>204</a>
<a name='L205'></a><a href='#L205'>205</a>
<a name='L206'></a><a href='#L206'>206</a>
<a name='L207'></a><a href='#L207'>207</a>
<a name='L208'></a><a href='#L208'>208</a>
<a name='L209'></a><a href='#L209'>209</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">export const genResponseByType = (
responseType: XMLHttpRequest['responseType'],
response: any,
): string | Record&lt;string, any&gt; =&gt; {
let result = ''
switch (responseType) {
<span class="branch-0 cbranch-no" title="branch not covered" > case '':</span>
<span class="branch-1 cbranch-no" title="branch not covered" > case 'text':</span>
case 'json':
if (typeof response == 'string') {
try {
result = JSON.parse(response)
} catch (e) {
// not a JSON string
<span class="cstat-no" title="statement not covered" > result = response.slice(0, 10000)</span>
}
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="else path not taken" >E</span>} else if (isPureObject(response) || Array.isArray(response)) {</span>
<span class="cstat-no" title="statement not covered" > result = JSON.stringify(response)</span>
<span class="cstat-no" title="statement not covered" > } else if (typeof response !== 'undefined') {</span>
<span class="cstat-no" title="statement not covered" > result = Object.prototype.toString.call(response)</span>
}
break
&nbsp;
case 'blob':
case 'document':
case 'arraybuffer':
default:
<span class="missing-if-branch" title="else path not taken" >E</span>if (typeof response !== 'undefined') {
result = Object.prototype.toString.call(response)
}
break
}
return result
}
&nbsp;
export const getStringResponseByType = (
responseType: XMLHttpRequest['responseType'],
response: any,
) =&gt; {
let result = ''
switch (responseType) {
<span class="branch-0 cbranch-no" title="branch not covered" > case '':</span>
<span class="branch-1 cbranch-no" title="branch not covered" > case 'text':</span>
case 'json':
if (typeof response == 'string') {
result = response
} else if (isPureObject(response) || <span class="branch-1 cbranch-no" title="branch not covered" >Array.isArray(response)) {</span>
result = JSON.stringify(response)
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="else path not taken" >E</span>} else if (typeof response !== 'undefined') {</span>
<span class="cstat-no" title="statement not covered" > result = Object.prototype.toString.call(response)</span>
}
break
case 'blob':
case 'document':
case 'arraybuffer':
default:
<span class="missing-if-branch" title="else path not taken" >E</span>if (typeof response !== 'undefined') {
result = Object.prototype.toString.call(response)
}
break
}
return result
}
&nbsp;
export const genStringBody = (body?: BodyInit) =&gt; {
<span class="missing-if-branch" title="if path not taken" >I</span>if (!body) {
<span class="cstat-no" title="statement not covered" > return null</span>
}
let result: string
&nbsp;
if (typeof body === 'string') {
<span class="missing-if-branch" title="else path not taken" >E</span>if (body[0] === '{' || <span class="branch-1 cbranch-no" title="branch not covered" >body[0] === '[') {</span>
result = body
}
// 'a=1&amp;b=2' =&gt; try to parse as query
const arr = body.split('&amp;')
if (arr.length === 1) {
// not a query, parse as original string
result = body
} else <span class="missing-if-branch" title="else path not taken" >E</span>{
// 'a=1&amp;b=2&amp;c' =&gt; parse as query
<span class="cstat-no" title="statement not covered" > result = arr.join(',')</span>
}
} else if (isIterable(body)) {
// FormData or URLSearchParams or Array
const arr = []
for (const [key, value] of &lt;FormData | URLSearchParams&gt;body) {
arr.push(`${key}=${typeof value === 'string' ? value : <span class="branch-1 cbranch-no" title="branch not covered" >'[object Object]'}</span>`)
}
result = arr.join(',')
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="else path not taken" >E</span>} else if (</span>
body instanceof Blob ||
body instanceof ReadableStream ||
body instanceof ArrayBuffer
) {
<span class="cstat-no" title="statement not covered" > result = 'byte data'</span>
<span class="cstat-no" title="statement not covered" > } else if (isPureObject(body)) {</span>
// overriding ArrayBufferView which is not convertable to string
<span class="cstat-no" title="statement not covered" > result = &lt;any&gt;body</span>
} else {
<span class="cstat-no" title="statement not covered" > result = `can't parse body ${typeof body}`</span>
}
return result
}
&nbsp;
export const genGetDataByUrl = (url: string, getData: Record&lt;string, any&gt; = {}) =&gt; {
if (!isPureObject(getData)) {
getData = {}
}
let query: string[] = url ? url.split('?') : <span class="branch-1 cbranch-no" title="branch not covered" >[] // a.php?b=c&amp;d=?e =&gt; ['a.php', 'b=c&amp;d=', 'e']</span>
query.shift() // =&gt; ['b=c&amp;d=', 'e']
<span class="missing-if-branch" title="else path not taken" >E</span>if (query.length &gt; 0) {
query = query.join('?').split('&amp;') // =&gt; 'b=c&amp;d=?e' =&gt; ['b=c', 'd=?e']
for (const q of query) {
const kv = q.split('=')
try {
getData[kv[0]] = decodeURIComponent(kv[1])
} catch (e) {
// "URIError: URI malformed" will be thrown when `kv[1]` contains "%", so just use raw data
// @issue #470
// @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Malformed_URI
<span class="cstat-no" title="statement not covered" > getData[kv[0]] = kv[1]</span>
}
}
}
return getData
}
&nbsp;
export const genFormattedBody = (body?: BodyInit) =&gt; {
<span class="missing-if-branch" title="if path not taken" >I</span>if (!body) {
<span class="cstat-no" title="statement not covered" > return null</span>
}
let result: string | { [key: string]: string }
&nbsp;
if (typeof body === 'string') {
try {
// '{a:1}' =&gt;
result = JSON.parse(body)
} catch (e) {
// 'a=1&amp;b=2' =&gt; try to parse as query
const arr = body.split('&amp;')
result = {}
// eslint-disable-next-line
for (let q of arr) {
const kv = q.split('=')
result[kv[0]] = kv[1] === undefined ? <span class="branch-0 cbranch-no" title="branch not covered" >'undefined' : k</span>v[1]
}
}
} else if (isIterable(body)) {
// FormData or URLSearchParams or Array
result = {}
for (const [key, value] of &lt;FormData | URLSearchParams&gt;body) {
result[key] = typeof value === 'string' ? value : <span class="branch-1 cbranch-no" title="branch not covered" >'[object Object]'</span>
}
} else if (
ArrayBuffer.isView(body) ||
body instanceof Blob ||
<span class="branch-2 cbranch-no" title="branch not covered" > body instanceof ReadableStream ||</span>
<span class="branch-3 cbranch-no" title="branch not covered" > body instanceof ArrayBuffer</span>
) {
result = '[byte data]'
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="else path not taken" >E</span>} else if (isPureObject(body)) {</span>
<span class="cstat-no" title="statement not covered" > result = &lt;any&gt;body</span>
} else {
<span class="cstat-no" title="statement not covered" > result = `can't parse body ${typeof body}`</span>
}
return result
}
&nbsp;
export function isPureObject(input: any): input is Record&lt;any, any&gt; {
return null !== input &amp;&amp; typeof input === 'object'
}
&nbsp;
export function isIterable(value: any) {
if (value === null || value === undefined) {
return false
}
if (ArrayBuffer.isView(value)) {
return false
}
return typeof Symbol !== 'undefined' &amp;&amp; typeof value[Symbol.iterator] === 'function'
}
&nbsp;
export function formatByteSize(bytes: number) {
if (bytes &lt;= 0) {
// shouldn't happen?
return ''
}
if (bytes &gt;= 1000 * 1000) {
return (bytes / 1000 / 1000).toFixed(1) + ' MB'
}
if (bytes &gt;= 1000) {
return (bytes / 1000).toFixed(1) + ' KB'
}
return `${bytes}B`
}
&nbsp;
export const getURL = (urlString: string) =&gt; {
if (urlString.startsWith('//')) {
const baseUrl = new URL(window.location.href)
urlString = `${baseUrl.protocol}${urlString}`
}
if (urlString.startsWith('http')) {
return new URL(urlString)
} else {
return new URL(urlString, window.location.href)
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-09-30T10:51:43.373Z
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -0,0 +1,874 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for xhrProxy.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="index.html">All files</a> xhrProxy.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Statements</span>
<span class='fraction'>0/126</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/59</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/26</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">0% </span>
<span class="quiet">Lines</span>
<span class='fraction'>0/124</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a>
<a name='L149'></a><a href='#L149'>149</a>
<a name='L150'></a><a href='#L150'>150</a>
<a name='L151'></a><a href='#L151'>151</a>
<a name='L152'></a><a href='#L152'>152</a>
<a name='L153'></a><a href='#L153'>153</a>
<a name='L154'></a><a href='#L154'>154</a>
<a name='L155'></a><a href='#L155'>155</a>
<a name='L156'></a><a href='#L156'>156</a>
<a name='L157'></a><a href='#L157'>157</a>
<a name='L158'></a><a href='#L158'>158</a>
<a name='L159'></a><a href='#L159'>159</a>
<a name='L160'></a><a href='#L160'>160</a>
<a name='L161'></a><a href='#L161'>161</a>
<a name='L162'></a><a href='#L162'>162</a>
<a name='L163'></a><a href='#L163'>163</a>
<a name='L164'></a><a href='#L164'>164</a>
<a name='L165'></a><a href='#L165'>165</a>
<a name='L166'></a><a href='#L166'>166</a>
<a name='L167'></a><a href='#L167'>167</a>
<a name='L168'></a><a href='#L168'>168</a>
<a name='L169'></a><a href='#L169'>169</a>
<a name='L170'></a><a href='#L170'>170</a>
<a name='L171'></a><a href='#L171'>171</a>
<a name='L172'></a><a href='#L172'>172</a>
<a name='L173'></a><a href='#L173'>173</a>
<a name='L174'></a><a href='#L174'>174</a>
<a name='L175'></a><a href='#L175'>175</a>
<a name='L176'></a><a href='#L176'>176</a>
<a name='L177'></a><a href='#L177'>177</a>
<a name='L178'></a><a href='#L178'>178</a>
<a name='L179'></a><a href='#L179'>179</a>
<a name='L180'></a><a href='#L180'>180</a>
<a name='L181'></a><a href='#L181'>181</a>
<a name='L182'></a><a href='#L182'>182</a>
<a name='L183'></a><a href='#L183'>183</a>
<a name='L184'></a><a href='#L184'>184</a>
<a name='L185'></a><a href='#L185'>185</a>
<a name='L186'></a><a href='#L186'>186</a>
<a name='L187'></a><a href='#L187'>187</a>
<a name='L188'></a><a href='#L188'>188</a>
<a name='L189'></a><a href='#L189'>189</a>
<a name='L190'></a><a href='#L190'>190</a>
<a name='L191'></a><a href='#L191'>191</a>
<a name='L192'></a><a href='#L192'>192</a>
<a name='L193'></a><a href='#L193'>193</a>
<a name='L194'></a><a href='#L194'>194</a>
<a name='L195'></a><a href='#L195'>195</a>
<a name='L196'></a><a href='#L196'>196</a>
<a name='L197'></a><a href='#L197'>197</a>
<a name='L198'></a><a href='#L198'>198</a>
<a name='L199'></a><a href='#L199'>199</a>
<a name='L200'></a><a href='#L200'>200</a>
<a name='L201'></a><a href='#L201'>201</a>
<a name='L202'></a><a href='#L202'>202</a>
<a name='L203'></a><a href='#L203'>203</a>
<a name='L204'></a><a href='#L204'>204</a>
<a name='L205'></a><a href='#L205'>205</a>
<a name='L206'></a><a href='#L206'>206</a>
<a name='L207'></a><a href='#L207'>207</a>
<a name='L208'></a><a href='#L208'>208</a>
<a name='L209'></a><a href='#L209'>209</a>
<a name='L210'></a><a href='#L210'>210</a>
<a name='L211'></a><a href='#L211'>211</a>
<a name='L212'></a><a href='#L212'>212</a>
<a name='L213'></a><a href='#L213'>213</a>
<a name='L214'></a><a href='#L214'>214</a>
<a name='L215'></a><a href='#L215'>215</a>
<a name='L216'></a><a href='#L216'>216</a>
<a name='L217'></a><a href='#L217'>217</a>
<a name='L218'></a><a href='#L218'>218</a>
<a name='L219'></a><a href='#L219'>219</a>
<a name='L220'></a><a href='#L220'>220</a>
<a name='L221'></a><a href='#L221'>221</a>
<a name='L222'></a><a href='#L222'>222</a>
<a name='L223'></a><a href='#L223'>223</a>
<a name='L224'></a><a href='#L224'>224</a>
<a name='L225'></a><a href='#L225'>225</a>
<a name='L226'></a><a href='#L226'>226</a>
<a name='L227'></a><a href='#L227'>227</a>
<a name='L228'></a><a href='#L228'>228</a>
<a name='L229'></a><a href='#L229'>229</a>
<a name='L230'></a><a href='#L230'>230</a>
<a name='L231'></a><a href='#L231'>231</a>
<a name='L232'></a><a href='#L232'>232</a>
<a name='L233'></a><a href='#L233'>233</a>
<a name='L234'></a><a href='#L234'>234</a>
<a name='L235'></a><a href='#L235'>235</a>
<a name='L236'></a><a href='#L236'>236</a>
<a name='L237'></a><a href='#L237'>237</a>
<a name='L238'></a><a href='#L238'>238</a>
<a name='L239'></a><a href='#L239'>239</a>
<a name='L240'></a><a href='#L240'>240</a>
<a name='L241'></a><a href='#L241'>241</a>
<a name='L242'></a><a href='#L242'>242</a>
<a name='L243'></a><a href='#L243'>243</a>
<a name='L244'></a><a href='#L244'>244</a>
<a name='L245'></a><a href='#L245'>245</a>
<a name='L246'></a><a href='#L246'>246</a>
<a name='L247'></a><a href='#L247'>247</a>
<a name='L248'></a><a href='#L248'>248</a>
<a name='L249'></a><a href='#L249'>249</a>
<a name='L250'></a><a href='#L250'>250</a>
<a name='L251'></a><a href='#L251'>251</a>
<a name='L252'></a><a href='#L252'>252</a>
<a name='L253'></a><a href='#L253'>253</a>
<a name='L254'></a><a href='#L254'>254</a>
<a name='L255'></a><a href='#L255'>255</a>
<a name='L256'></a><a href='#L256'>256</a>
<a name='L257'></a><a href='#L257'>257</a>
<a name='L258'></a><a href='#L258'>258</a>
<a name='L259'></a><a href='#L259'>259</a>
<a name='L260'></a><a href='#L260'>260</a>
<a name='L261'></a><a href='#L261'>261</a>
<a name='L262'></a><a href='#L262'>262</a>
<a name='L263'></a><a href='#L263'>263</a>
<a name='L264'></a><a href='#L264'>264</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/**
* I took inspiration in few stack exchange posts
* and Tencent vConsole library (MIT)
* by wrapping the XMLHttpRequest object in a Proxy
* we can intercept the network requests
* in not-so-hacky way
* */
&nbsp;
import NetworkMessage from './networkMessage'
import { RequestState, INetworkMessage, RequestResponseData } from './types';
import { genGetDataByUrl, formatByteSize, genStringBody, getStringResponseByType } from './utils'
&nbsp;
export class XHRProxyHandler&lt;T extends XMLHttpRequest&gt; implements ProxyHandler&lt;T&gt; {
public XMLReq: XMLHttpRequest
public item: NetworkMessage
&nbsp;
<span class="fstat-no" title="function not covered" > constructor(</span>
XMLReq: XMLHttpRequest,
private readonly <span class="cstat-no" title="statement not covered" >ignoredHeaders: boolean | string[],</span>
private readonly <span class="cstat-no" title="statement not covered" >setSessionTokenHeader: (cb: (name: string, value: string) =&gt; void) =&gt; void,</span>
private readonly <span class="cstat-no" title="statement not covered" >sanitize: (data: RequestResponseData) =&gt; RequestResponseData | null,</span>
private readonly <span class="cstat-no" title="statement not covered" >sendMessage: (message: INetworkMessage) =&gt; void,</span>
private readonly <span class="cstat-no" title="statement not covered" >isServiceUrl: (url: string) =&gt; boolean,</span>
private readonly <span class="cstat-no" title="statement not covered" >tokenUrlMatcher?: (url: string) =&gt; boolean,</span>
) {
<span class="cstat-no" title="statement not covered" > this.XMLReq = XMLReq</span>
<span class="cstat-no" title="statement not covered" > this.XMLReq.onreadystatechange = <span class="fstat-no" title="function not covered" >() =&gt; {</span></span>
<span class="cstat-no" title="statement not covered" > this.onReadyStateChange()</span>
}
<span class="cstat-no" title="statement not covered" > this.XMLReq.onabort = <span class="fstat-no" title="function not covered" >() =&gt; {</span></span>
<span class="cstat-no" title="statement not covered" > this.onAbort()</span>
}
<span class="cstat-no" title="statement not covered" > this.XMLReq.ontimeout = <span class="fstat-no" title="function not covered" >() =&gt; {</span></span>
<span class="cstat-no" title="statement not covered" > this.onTimeout()</span>
}
<span class="cstat-no" title="statement not covered" > this.item = new NetworkMessage(ignoredHeaders, setSessionTokenHeader, sanitize)</span>
<span class="cstat-no" title="statement not covered" > this.item.requestType = 'xhr'</span>
}
&nbsp;
public <span class="fstat-no" title="function not covered" >get(t</span>arget: T, key: string) {
<span class="cstat-no" title="statement not covered" > switch (key) {</span>
case 'open':
<span class="cstat-no" title="statement not covered" > return this.getOpen(target)</span>
case 'send':
<span class="cstat-no" title="statement not covered" > this.setSessionTokenHeader(<span class="fstat-no" title="function not covered" >(n</span>ame: string, value: string) =&gt; {</span>
<span class="cstat-no" title="statement not covered" > if (this.tokenUrlMatcher !== undefined) {</span>
<span class="cstat-no" title="statement not covered" > if (!this.tokenUrlMatcher(this.item.url)) {</span>
<span class="cstat-no" title="statement not covered" > return</span>
}
}
<span class="cstat-no" title="statement not covered" > target.setRequestHeader(name, value)</span>
})
<span class="cstat-no" title="statement not covered" > return this.getSend(target)</span>
case 'setRequestHeader':
<span class="cstat-no" title="statement not covered" > return this.getSetRequestHeader(target)</span>
default:
// eslint-disable-next-line no-case-declarations
const value = <span class="cstat-no" title="statement not covered" >Reflect.get(target, key)</span>
<span class="cstat-no" title="statement not covered" > if (typeof value === 'function') {</span>
<span class="cstat-no" title="statement not covered" > return value.bind(target)</span>
} else {
<span class="cstat-no" title="statement not covered" > return value</span>
}
}
}
&nbsp;
public <span class="fstat-no" title="function not covered" >set(t</span>arget: T, key: string, value: (args: any[]) =&gt; any) {
<span class="cstat-no" title="statement not covered" > switch (key) {</span>
case 'onreadystatechange':
<span class="cstat-no" title="statement not covered" > return this.setOnReadyStateChange(target, key, value)</span>
case 'onabort':
<span class="cstat-no" title="statement not covered" > return this.setOnAbort(target, key, value)</span>
case 'ontimeout':
<span class="cstat-no" title="statement not covered" > return this.setOnTimeout(target, key, value)</span>
default:
// not tracked methods
}
<span class="cstat-no" title="statement not covered" > return Reflect.set(target, key, value)</span>
}
&nbsp;
public <span class="fstat-no" title="function not covered" >onReadyStateChange() {</span>
<span class="cstat-no" title="statement not covered" > if (this.item.url &amp;&amp; this.isServiceUrl(this.item.url)) <span class="cstat-no" title="statement not covered" >return</span></span>
<span class="cstat-no" title="statement not covered" > this.item.readyState = this.XMLReq.readyState</span>
<span class="cstat-no" title="statement not covered" > this.item.responseType = this.XMLReq.responseType</span>
<span class="cstat-no" title="statement not covered" > this.item.endTime = performance.now()</span>
<span class="cstat-no" title="statement not covered" > this.item.duration = this.item.endTime - this.item.startTime</span>
<span class="cstat-no" title="statement not covered" > this.updateItemByReadyState()</span>
<span class="cstat-no" title="statement not covered" > setTimeout(<span class="fstat-no" title="function not covered" >() =&gt; {</span></span>
<span class="cstat-no" title="statement not covered" > this.item.response = getStringResponseByType(this.item.responseType, this.item.response)</span>
}, 0)
&nbsp;
<span class="cstat-no" title="statement not covered" > if (this.XMLReq.readyState === RequestState.DONE) {</span>
const msg = <span class="cstat-no" title="statement not covered" >this.item.getMessage()</span>
<span class="cstat-no" title="statement not covered" > if (msg) {</span>
<span class="cstat-no" title="statement not covered" > this.sendMessage(msg)</span>
}
}
}
&nbsp;
public <span class="fstat-no" title="function not covered" >onAbort() {</span>
<span class="cstat-no" title="statement not covered" > this.item.cancelState = 1</span>
<span class="cstat-no" title="statement not covered" > this.item.statusText = 'Abort'</span>
&nbsp;
const msg = <span class="cstat-no" title="statement not covered" >this.item.getMessage()</span>
<span class="cstat-no" title="statement not covered" > if (msg) {</span>
<span class="cstat-no" title="statement not covered" > this.sendMessage(msg)</span>
}
}
&nbsp;
public <span class="fstat-no" title="function not covered" >onTimeout() {</span>
<span class="cstat-no" title="statement not covered" > this.item.cancelState = 3</span>
<span class="cstat-no" title="statement not covered" > this.item.statusText = 'Timeout'</span>
&nbsp;
const msg = <span class="cstat-no" title="statement not covered" >this.item.getMessage()</span>
<span class="cstat-no" title="statement not covered" > if (msg) {</span>
<span class="cstat-no" title="statement not covered" > this.sendMessage(msg)</span>
}
}
&nbsp;
protected <span class="fstat-no" title="function not covered" >getOpen(t</span>arget: T) {
const targetFunction = <span class="cstat-no" title="statement not covered" >Reflect.get(target, 'open')</span>
<span class="cstat-no" title="statement not covered" > return <span class="fstat-no" title="function not covered" >(...a</span>rgs: any[]) =&gt; {</span>
const method = <span class="cstat-no" title="statement not covered" >args[0]</span>
const url = <span class="cstat-no" title="statement not covered" >args[1]</span>
<span class="cstat-no" title="statement not covered" > this.item.method = method ? method.toUpperCase() : 'GET'</span>
<span class="cstat-no" title="statement not covered" > this.item.url = url.toString?.() || ''</span>
<span class="cstat-no" title="statement not covered" > this.item.name = this.item.url?.replace(new RegExp('/*$'), '').split('/').pop() ?? ''</span>
<span class="cstat-no" title="statement not covered" > this.item.getData = genGetDataByUrl(this.item.url, {})</span>
<span class="cstat-no" title="statement not covered" > return targetFunction.apply(target, args)</span>
}
}
&nbsp;
protected <span class="fstat-no" title="function not covered" >getSend(t</span>arget: T) {
const targetFunction = <span class="cstat-no" title="statement not covered" >Reflect.get(target, 'send')</span>
<span class="cstat-no" title="statement not covered" > return <span class="fstat-no" title="function not covered" >(...a</span>rgs: any[]) =&gt; {</span>
const data: XMLHttpRequestBodyInit = <span class="cstat-no" title="statement not covered" >args[0]</span>
<span class="cstat-no" title="statement not covered" > this.item.requestData = genStringBody(data)</span>
<span class="cstat-no" title="statement not covered" > return targetFunction.apply(target, args)</span>
}
}
&nbsp;
protected <span class="fstat-no" title="function not covered" >getSetRequestHeader(t</span>arget: T) {
const targetFunction = <span class="cstat-no" title="statement not covered" >Reflect.get(target, 'setRequestHeader')</span>
<span class="cstat-no" title="statement not covered" > return <span class="fstat-no" title="function not covered" >(...a</span>rgs: any[]) =&gt; {</span>
<span class="cstat-no" title="statement not covered" > if (!this.item.requestHeader) {</span>
<span class="cstat-no" title="statement not covered" > this.item.requestHeader = {}</span>
}
// @ts-ignore
<span class="cstat-no" title="statement not covered" > this.item.requestHeader[args[0]] = args[1]</span>
<span class="cstat-no" title="statement not covered" > return targetFunction.apply(target, args)</span>
}
}
&nbsp;
protected <span class="fstat-no" title="function not covered" >setOnReadyStateChange(t</span>arget: T, key: string, orscFunction: (args: any[]) =&gt; any) {
<span class="cstat-no" title="statement not covered" > return Reflect.set(target, key, <span class="fstat-no" title="function not covered" >(...a</span>rgs: any[]) =&gt; {</span>
<span class="cstat-no" title="statement not covered" > this.onReadyStateChange()</span>
<span class="cstat-no" title="statement not covered" > orscFunction?.apply(target, args)</span>
})
}
&nbsp;
protected <span class="fstat-no" title="function not covered" >setOnAbort(t</span>arget: T, key: string, oaFunction: (args: any[]) =&gt; any) {
<span class="cstat-no" title="statement not covered" > return Reflect.set(target, key, <span class="fstat-no" title="function not covered" >(...a</span>rgs: any[]) =&gt; {</span>
<span class="cstat-no" title="statement not covered" > this.onAbort()</span>
<span class="cstat-no" title="statement not covered" > oaFunction.apply(target, args)</span>
})
}
&nbsp;
protected <span class="fstat-no" title="function not covered" >setOnTimeout(t</span>arget: T, key: string, otFunction: (args: any[]) =&gt; any) {
<span class="cstat-no" title="statement not covered" > return Reflect.set(target, key, <span class="fstat-no" title="function not covered" >(...a</span>rgs: any[]) =&gt; {</span>
<span class="cstat-no" title="statement not covered" > this.onTimeout()</span>
<span class="cstat-no" title="statement not covered" > otFunction.apply(target, args)</span>
})
}
&nbsp;
/**
* Update item's properties according to readyState.
*/
protected <span class="fstat-no" title="function not covered" >updateItemByReadyState() {</span>
<span class="cstat-no" title="statement not covered" > switch (this.XMLReq.readyState) {</span>
case RequestState.UNSENT:
case RequestState.OPENED:
<span class="cstat-no" title="statement not covered" > this.item.status = RequestState.UNSENT</span>
<span class="cstat-no" title="statement not covered" > this.item.statusText = 'Pending'</span>
<span class="cstat-no" title="statement not covered" > if (!this.item.startTime) {</span>
<span class="cstat-no" title="statement not covered" > this.item.startTime = performance.now()</span>
}
<span class="cstat-no" title="statement not covered" > break</span>
case RequestState.HEADERS_RECEIVED:
<span class="cstat-no" title="statement not covered" > this.item.status = this.XMLReq.status</span>
<span class="cstat-no" title="statement not covered" > this.item.statusText = 'Loading'</span>
<span class="cstat-no" title="statement not covered" > this.item.header = {}</span>
// eslint-disable-next-line no-case-declarations
const header = <span class="cstat-no" title="statement not covered" >this.XMLReq.getAllResponseHeaders() || '',</span>
headerArr = <span class="cstat-no" title="statement not covered" >header.split('\n')</span>
// extract plain text to key-value format
<span class="cstat-no" title="statement not covered" > for (let i = <span class="cstat-no" title="statement not covered" >0; i</span> &lt; headerArr.length; i++) {</span>
const line = <span class="cstat-no" title="statement not covered" >headerArr[i]</span>
<span class="cstat-no" title="statement not covered" > if (!line) {</span>
<span class="cstat-no" title="statement not covered" > continue</span>
}
const arr = <span class="cstat-no" title="statement not covered" >line.split(': ')</span>
const key = <span class="cstat-no" title="statement not covered" >arr[0]</span>
<span class="cstat-no" title="statement not covered" > this.item.header[key] = arr.slice(1).join(': ')</span>
}
<span class="cstat-no" title="statement not covered" > break</span>
case RequestState.LOADING:
<span class="cstat-no" title="statement not covered" > this.item.status = this.XMLReq.status</span>
<span class="cstat-no" title="statement not covered" > this.item.statusText = 'Loading'</span>
<span class="cstat-no" title="statement not covered" > if (!!this.XMLReq.response &amp;&amp; this.XMLReq.response.length) {</span>
<span class="cstat-no" title="statement not covered" > this.item.responseSize = this.XMLReq.response.length</span>
<span class="cstat-no" title="statement not covered" > this.item.responseSizeText = formatByteSize(this.item.responseSize)</span>
}
<span class="cstat-no" title="statement not covered" > break</span>
case RequestState.DONE:
// `XMLReq.abort()` will change `status` from 200 to 0, so use previous value in this case
<span class="cstat-no" title="statement not covered" > this.item.status = this.XMLReq.status || this.item.status || 0</span>
// show status code when request completed
<span class="cstat-no" title="statement not covered" > this.item.statusText = String(this.item.status)</span>
<span class="cstat-no" title="statement not covered" > this.item.endTime = performance.now()</span>
<span class="cstat-no" title="statement not covered" > this.item.duration = this.item.endTime - (this.item.startTime || this.item.endTime)</span>
<span class="cstat-no" title="statement not covered" > this.item.response = this.XMLReq.response</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > if (!!this.XMLReq.response &amp;&amp; this.XMLReq.response.length) {</span>
<span class="cstat-no" title="statement not covered" > this.item.responseSize = this.XMLReq.response.length</span>
<span class="cstat-no" title="statement not covered" > this.item.responseSizeText = formatByteSize(this.item.responseSize)</span>
}
<span class="cstat-no" title="statement not covered" > break</span>
default:
<span class="cstat-no" title="statement not covered" > this.item.status = this.XMLReq.status</span>
<span class="cstat-no" title="statement not covered" > this.item.statusText = 'Unknown'</span>
<span class="cstat-no" title="statement not covered" > break</span>
}
}
}
&nbsp;
export default class XHRProxy {
<span class="fstat-no" title="function not covered" > public static c</span>reate(
ignoredHeaders: boolean | string[],
setSessionTokenHeader: (cb: (name: string, value: string) =&gt; void) =&gt; void,
sanitize: (data: RequestResponseData) =&gt; RequestResponseData | null,
sendMessage: (data: INetworkMessage) =&gt; void,
isServiceUrl: (url: string) =&gt; boolean,
tokenUrlMatcher?: (url: string) =&gt; boolean,
) {
<span class="cstat-no" title="statement not covered" > return new Proxy(XMLHttpRequest, {</span>
<span class="fstat-no" title="function not covered" > construct(o</span>riginal: any) {
const XMLReq = <span class="cstat-no" title="statement not covered" >new original()</span>
<span class="cstat-no" title="statement not covered" > return new Proxy(</span>
XMLReq,
new XHRProxyHandler(
XMLReq as XMLHttpRequest,
ignoredHeaders,
setSessionTokenHeader,
sanitize,
sendMessage,
isServiceUrl,
tokenUrlMatcher,
),
)
},
})
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-09-30T10:51:43.373Z
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View file

@ -10,13 +10,15 @@
], ],
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"test": "vitest" "test": "vitest",
"test:ci": "vitest --coverage"
}, },
"author": "Nikita <nikita@openreplay.com>", "author": "Nikita <nikita@openreplay.com>",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@vitest/coverage-istanbul": "^2.1.1",
"jsdom": "^25.0.1", "jsdom": "^25.0.1",
"vitest": "^2.1.1", "typescript": "^5.6.2",
"typescript": "^5.6.2" "vitest": "^2.1.1"
} }
} }

View file

@ -3,6 +3,9 @@ import { defineConfig } from 'vitest/config'
export default defineConfig(({ mode }) => ({ export default defineConfig(({ mode }) => ({
define: { global: 'window' }, define: { global: 'window' },
test: { test: {
environment: "jsdom" environment: "jsdom",
coverage: {
provider: 'istanbul' // or 'v8'
},
} }
})); }));

1439
networkProxy/yarn.lock Normal file

File diff suppressed because it is too large Load diff