Deploy documentation and coverage

This commit is contained in:
github-actions[bot]
2024-08-22 22:18:01 +00:00
parent 7b3cd054f2
commit e2a6555422
57 changed files with 867 additions and 362 deletions

View File

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="104" height="20" role="img" aria-label="branches: 100%"><title>branches: 100%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="104" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="61" height="20" fill="#555"/><rect x="61" width="43" height="20" fill="#4c1"/><rect width="104" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="315" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">branches</text><text x="315" y="140" transform="scale(.1)" fill="#fff" textLength="510">branches</text><text aria-hidden="true" x="815" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="330">100%</text><text x="815" y="140" transform="scale(.1)" fill="#fff" textLength="330">100%</text></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="114" height="20" role="img" aria-label="branches: 91.66%"><title>branches: 91.66%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="114" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="61" height="20" fill="#555"/><rect x="61" width="53" height="20" fill="#4c1"/><rect width="114" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="315" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">branches</text><text x="315" y="140" transform="scale(.1)" fill="#fff" textLength="510">branches</text><text aria-hidden="true" x="865" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">91.66%</text><text x="865" y="140" transform="scale(.1)" fill="#fff" textLength="430">91.66%</text></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="104" height="20" role="img" aria-label="functions: 100%"><title>functions: 100%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="104" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="61" height="20" fill="#555"/><rect x="61" width="43" height="20" fill="#4c1"/><rect width="104" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="315" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">functions</text><text x="315" y="140" transform="scale(.1)" fill="#fff" textLength="510">functions</text><text aria-hidden="true" x="815" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="330">100%</text><text x="815" y="140" transform="scale(.1)" fill="#fff" textLength="330">100%</text></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="114" height="20" role="img" aria-label="functions: 96.42%"><title>functions: 96.42%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="114" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="61" height="20" fill="#555"/><rect x="61" width="53" height="20" fill="#4c1"/><rect width="114" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="315" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">functions</text><text x="315" y="140" transform="scale(.1)" fill="#fff" textLength="510">functions</text><text aria-hidden="true" x="865" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">96.42%</text><text x="865" y="140" transform="scale(.1)" fill="#fff" textLength="430">96.42%</text></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="78" height="20" role="img" aria-label="lines: 100%"><title>lines: 100%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="78" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="35" height="20" fill="#555"/><rect x="35" width="43" height="20" fill="#4c1"/><rect width="78" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="185" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">lines</text><text x="185" y="140" transform="scale(.1)" fill="#fff" textLength="250">lines</text><text aria-hidden="true" x="555" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="330">100%</text><text x="555" y="140" transform="scale(.1)" fill="#fff" textLength="330">100%</text></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="88" height="20" role="img" aria-label="lines: 96.73%"><title>lines: 96.73%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="88" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="35" height="20" fill="#555"/><rect x="35" width="53" height="20" fill="#4c1"/><rect width="88" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="185" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">lines</text><text x="185" y="140" transform="scale(.1)" fill="#fff" textLength="250">lines</text><text aria-hidden="true" x="605" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">96.73%</text><text x="605" y="140" transform="scale(.1)" fill="#fff" textLength="430">96.73%</text></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="114" height="20" role="img" aria-label="statements: 100%"><title>statements: 100%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="114" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="71" height="20" fill="#555"/><rect x="71" width="43" height="20" fill="#4c1"/><rect width="114" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="365" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="610">statements</text><text x="365" y="140" transform="scale(.1)" fill="#fff" textLength="610">statements</text><text aria-hidden="true" x="915" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="330">100%</text><text x="915" y="140" transform="scale(.1)" fill="#fff" textLength="330">100%</text></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="124" height="20" role="img" aria-label="statements: 96.84%"><title>statements: 96.84%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="124" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="71" height="20" fill="#555"/><rect x="71" width="53" height="20" fill="#4c1"/><rect width="124" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="365" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="610">statements</text><text x="365" y="140" transform="scale(.1)" fill="#fff" textLength="610">statements</text><text aria-hidden="true" x="965" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">96.84%</text><text x="965" y="140" transform="scale(.1)" fill="#fff" textLength="430">96.84%</text></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,9 +1,9 @@
{"total": {"lines":{"total":70,"covered":70,"skipped":0,"pct":100},"statements":{"total":72,"covered":72,"skipped":0,"pct":100},"functions":{"total":20,"covered":20,"skipped":0,"pct":100},"branches":{"total":22,"covered":22,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}
{"total": {"lines":{"total":92,"covered":89,"skipped":0,"pct":96.73},"statements":{"total":95,"covered":92,"skipped":0,"pct":96.84},"functions":{"total":28,"covered":27,"skipped":0,"pct":96.42},"branches":{"total":48,"covered":44,"skipped":0,"pct":91.66},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/home/runner/work/TSinjex/TSinjex/src/classes/TSinjex.ts": {"lines":{"total":19,"covered":19,"skipped":0,"pct":100},"functions":{"total":6,"covered":6,"skipped":0,"pct":100},"statements":{"total":21,"covered":21,"skipped":0,"pct":100},"branches":{"total":11,"covered":11,"skipped":0,"pct":100}}
,"/home/runner/work/TSinjex/TSinjex/src/decorators/Inject.ts": {"lines":{"total":16,"covered":16,"skipped":0,"pct":100},"functions":{"total":4,"covered":4,"skipped":0,"pct":100},"statements":{"total":16,"covered":16,"skipped":0,"pct":100},"branches":{"total":5,"covered":5,"skipped":0,"pct":100}}
,"/home/runner/work/TSinjex/TSinjex/src/decorators/Inject.ts": {"lines":{"total":29,"covered":28,"skipped":0,"pct":96.55},"functions":{"total":9,"covered":9,"skipped":0,"pct":100},"statements":{"total":30,"covered":29,"skipped":0,"pct":96.66},"branches":{"total":31,"covered":27,"skipped":0,"pct":87.09}}
,"/home/runner/work/TSinjex/TSinjex/src/decorators/Register.ts": {"lines":{"total":5,"covered":5,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":5,"covered":5,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/home/runner/work/TSinjex/TSinjex/src/decorators/RegisterInstance.ts": {"lines":{"total":18,"covered":18,"skipped":0,"pct":100},"functions":{"total":4,"covered":4,"skipped":0,"pct":100},"statements":{"total":18,"covered":18,"skipped":0,"pct":100},"branches":{"total":6,"covered":6,"skipped":0,"pct":100}}
,"/home/runner/work/TSinjex/TSinjex/src/functions/register.ts": {"lines":{"total":3,"covered":3,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":3,"covered":3,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/home/runner/work/TSinjex/TSinjex/src/functions/resolve.ts": {"lines":{"total":3,"covered":3,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":3,"covered":3,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/home/runner/work/TSinjex/TSinjex/src/interfaces/Exceptions.ts": {"lines":{"total":6,"covered":6,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":6,"covered":6,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/home/runner/work/TSinjex/TSinjex/src/interfaces/Exceptions.ts": {"lines":{"total":15,"covered":13,"skipped":0,"pct":86.66},"functions":{"total":5,"covered":4,"skipped":0,"pct":80},"statements":{"total":15,"covered":13,"skipped":0,"pct":86.66},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
}

View File

@@ -223,7 +223,7 @@
<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">16x</span>
<span class="cline-any cline-yes">22x</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>
@@ -237,11 +237,11 @@
<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">33x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">45x</span>
<span class="cline-any cline-yes">22x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">33x</span>
<span class="cline-any cline-yes">45x</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>
@@ -287,7 +287,7 @@
<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">11x</span>
<span class="cline-any cline-yes">17x</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>
@@ -297,22 +297,22 @@
<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">18x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">22x</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">15x</span>
<span class="cline-any cline-yes">21x</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-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">15x</span>
<span class="cline-any cline-yes">21x</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>
@@ -433,7 +433,7 @@ export class TSinjex implements ITSinjex {
}
&nbsp;
if (dependency.deprecated) {
console.warn(`Dependency ${identifier} is deprecated`);
console.warn(`Dependency ${identifier.toString()} is deprecated`);
&nbsp;
// Remove the deprecation warning; it should only be logged once.
dependency.deprecated = false;
@@ -451,7 +451,7 @@ export class TSinjex implements ITSinjex {
<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-08-16T16:49:06.383Z
at 2024-08-22T22:17:58.876Z
</div>
<script src="../prettify.js"></script>
<script>

View File

@@ -101,7 +101,7 @@
<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-08-16T16:49:06.383Z
at 2024-08-22T22:17:58.876Z
</div>
<script src="../prettify.js"></script>
<script>

View File

@@ -23,30 +23,30 @@
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="strong">96.66% </span>
<span class="quiet">Statements</span>
<span class='fraction'>16/16</span>
<span class='fraction'>29/30</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="strong">87.09% </span>
<span class="quiet">Branches</span>
<span class='fraction'>5/5</span>
<span class='fraction'>27/31</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>4/4</span>
<span class='fraction'>9/9</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="strong">96.55% </span>
<span class="quiet">Lines</span>
<span class='fraction'>16/16</span>
<span class='fraction'>28/29</span>
</div>
@@ -140,7 +140,92 @@
<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></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
<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></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-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>
@@ -176,37 +261,94 @@
<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">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">10x</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-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">10x</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">10x</span>
<span class="cline-any cline-yes">10x</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">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-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7x</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-yes">7x</span>
<span class="cline-any cline-yes">5x</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">2x</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-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">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-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-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-yes">13x</span>
<span class="cline-any cline-yes">13x</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">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>
@@ -216,8 +358,20 @@
<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-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { TSinjex } from '../classes/TSinjex';
<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></td><td class="text"><pre class="prettyprint lang-js">import {
DependencyResolutionError,
InitializationError,
InjectorError,
NoInstantiationMethodError,
} from 'src/interfaces/Exceptions';
import { TSinjex } from '../classes/TSinjex';
import { Identifier } from '../types/Identifier';
import { InitDelegate } from '../types/InitDelegate';
&nbsp;
@@ -227,12 +381,17 @@ import { InitDelegate } from '../types/InitDelegate';
* @template U The type of the property to be injected.
* @param identifier The identifier used to resolve the class in the DI container.
* @see {@link Identifier} for more information on identifiers.
* @param init An optional initializer function to transform the dependency before injection.
* @param init Optional an initializer function to transform the dependency before injection
* or true to instantiate the dependency if it has a constructor.
* @see {@link InitDelegate} for more information on initializer functions.
* @param necessary If true, throws an error if the dependency is not found.
* @returns The resolved dependency or undefined if the dependency is not necessary
* and not found, or throws an error if the dependency is necessary and not found.
* @throws A {@link DependencyResolutionError} if the dependency is not found and necessary.
* @throws **Only throws errors if the dependency is necessary.**
* @throws A {@link DependencyResolutionError} if the dependency is not found.
* @throws A {@link InjectorError} if an error occurs during the injection process.
* @throws A {@link NoInstantiationMethodError} if the dependency does not have a constructor.
* @throws An {@link InitializationError} if an error occurs during the initialization process.
* @example
* ```ts
* class MyClass {
@@ -250,50 +409,113 @@ import { InitDelegate } from '../types/InitDelegate';
*/
export function Inject&lt;T, U&gt;(
identifier: Identifier,
init?: InitDelegate&lt;T, U&gt;,
init?: InitDelegate&lt;T, U&gt; | true,
necessary = true,
) {
return function (target: unknown, propertyKey: string | symbol): void {
// Unique symbol to store the private property
const privatePropertyKey: unique symbol = Symbol();
// Get the DI container instance
const diContainer = TSinjex.getInstance();
&nbsp;
// Function to evaluate the dependency lazily
// to avoid circular dependencies, not found dependencies, etc.
const evaluate = (): T | undefined =&gt; {
return diContainer.resolve&lt;T&gt;(identifier, necessary);
/**
* Function to evaluate the dependency lazily
* to avoid circular dependencies, not found dependencies, etc.
* @returns The resolved dependency or undefined if the dependency is not found.
*/
const resolve = (): T | undefined =&gt; {
return TSinjex.getInstance().resolve&lt;T&gt;(identifier, necessary);
};
&nbsp;
// Define the property
Object.defineProperty(target, propertyKey, {
get() {
// If the property is not defined, evaluate the dependency
if (!this.hasOwnProperty(privatePropertyKey)) {
if (init) {
try {
this[privatePropertyKey] = init(evaluate() as T);
} catch (error) {
if (necessary) {
throw error;
}
}
} else {
this[privatePropertyKey] = evaluate();
}
}
let instance: T | U | undefined;
&nbsp;
return this[privatePropertyKey];
const dependency: T | undefined = tryAndCatch(
() =&gt; resolve(),
necessary,
identifier,
DependencyResolutionError,
);
&nbsp;
if (dependency != null) {
const initFunction: (() =&gt; U) | undefined =
typeof init === 'function' &amp;&amp; dependency != null
? (): U =&gt; init(dependency)
: init === true &amp;&amp; hasConstructor(dependency)
? (): U =&gt; new dependency() as U
: undefined;
&nbsp;
if (init == null) instance = dependency;
else if (initFunction != null)
instance = tryAndCatch(
initFunction,
necessary,
identifier,
InitializationError,
);
else if (necessary)
throw new NoInstantiationMethodError(identifier);
} else if (necessary)
throw new DependencyResolutionError(identifier);
&nbsp;
/**
* Replace itself with the resolved dependency
* for performance reasons.
*/
Object.defineProperty(this, propertyKey, {
value: instance,
writable: false,
enumerable: false,
configurable: false,
});
&nbsp;
return instance;
},
// Not necessary to set the property
// set(value: PropertieType) {
// this[privatePropertyKey] = value;
// },
enumerable: true,
configurable: false,
/**
* Make the property configurable to allow replacing it
*/
configurable: true,
});
};
}
&nbsp;
/**
* Tries to execute a function and catches any errors that occur.
* If the function is necessary and an error occurs, it throws the error
* with the specified error class and identifier.
* @param fn The function to execute.
* @param necessary If true, throws an error if an error occurs.
* @param identifier The identifier of the dependency.
* @param errorClass The error class to throw if an error occurs.
* @returns The result of the function or undefined if an error occurs and the function is not necessary.
*/
function tryAndCatch&lt;ReturnType, ErrorType&gt;(
fn: () =&gt; ReturnType,
necessary: boolean,
identifier?: Identifier,
errorClass?: ErrorType,
): ReturnType | undefined {
try {
return fn();
} catch (error) {
if (necessary)
throw new (errorClass != null ? errorClass : <span class="branch-1 cbranch-no" title="branch not covered" >error)</span>(
identifier ?? <span class="branch-1 cbranch-no" title="branch not covered" >'not specified',</span>
error,
);
else <span class="cstat-no" title="statement not covered" ><span class="missing-if-branch" title="else path not taken" >E</span>return undefined;</span>
}
}
&nbsp;
/**
* Checks if an object has a constructor.
* @param obj The object to check.
* @returns True if the object has a constructor, false otherwise.
*/
function hasConstructor&lt;T&gt;(obj: T): obj is T &amp; { new (): unknown } {
const _obj = obj as unknown as { prototype?: { constructor?: unknown } };
&nbsp;
return (
_obj<span class="branch-0 cbranch-no" title="branch not covered" >?.p</span>rototype != null &amp;&amp;
typeof _obj.prototype.constructor === 'function'
);
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
@@ -301,7 +523,7 @@ export function Inject&lt;T, U&gt;(
<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-08-16T16:49:06.383Z
at 2024-08-22T22:17:58.876Z
</div>
<script src="../prettify.js"></script>
<script>

View File

@@ -160,7 +160,7 @@ export function Register&lt;
<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-08-16T16:49:06.383Z
at 2024-08-22T22:17:58.876Z
</div>
<script src="../prettify.js"></script>
<script>

View File

@@ -289,7 +289,7 @@ export function RegisterInstance&lt;
<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-08-16T16:49:06.383Z
at 2024-08-22T22:17:58.876Z
</div>
<script src="../prettify.js"></script>
<script>

View File

@@ -23,30 +23,30 @@
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="strong">98.11% </span>
<span class="quiet">Statements</span>
<span class='fraction'>39/39</span>
<span class='fraction'>52/53</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="strong">89.18% </span>
<span class="quiet">Branches</span>
<span class='fraction'>11/11</span>
<span class='fraction'>33/37</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>10/10</span>
<span class='fraction'>15/15</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="strong">98.07% </span>
<span class="quiet">Lines</span>
<span class='fraction'>39/39</span>
<span class='fraction'>51/52</span>
</div>
@@ -80,17 +80,17 @@
</thead>
<tbody><tr>
<td class="file high" data-value="Inject.ts"><a href="./Inject.ts.html">Inject.ts</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
<td data-value="96.66" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 96%"></div><div class="cover-empty" style="width: 4%"></div></div>
</td>
<td data-value="96.66" class="pct high">96.66%</td>
<td data-value="30" class="abs high">29/30</td>
<td data-value="87.09" class="pct medium">87.09%</td>
<td data-value="31" class="abs medium">27/31</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="16" class="abs high">16/16</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="5" class="abs high">5/5</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="4" class="abs high">4/4</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="16" class="abs high">16/16</td>
<td data-value="9" class="abs high">9/9</td>
<td data-value="96.55" class="pct high">96.55%</td>
<td data-value="29" class="abs high">28/29</td>
</tr>
<tr>
@@ -131,7 +131,7 @@
<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-08-16T16:49:06.383Z
at 2024-08-22T22:17:58.876Z
</div>
<script src="../prettify.js"></script>
<script>

View File

@@ -116,7 +116,7 @@
<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-08-16T16:49:06.383Z
at 2024-08-22T22:17:58.876Z
</div>
<script src="../prettify.js"></script>
<script>

View File

@@ -187,7 +187,7 @@ export function register&lt;T&gt;(
<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-08-16T16:49:06.383Z
at 2024-08-22T22:17:58.876Z
</div>
<script src="../prettify.js"></script>
<script>

View File

@@ -190,7 +190,7 @@ export function resolve&lt;T&gt;(
<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-08-16T16:49:06.383Z
at 2024-08-22T22:17:58.876Z
</div>
<script src="../prettify.js"></script>
<script>

View File

@@ -23,30 +23,30 @@
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="strong">96.84% </span>
<span class="quiet">Statements</span>
<span class='fraction'>72/72</span>
<span class='fraction'>92/95</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="strong">91.66% </span>
<span class="quiet">Branches</span>
<span class='fraction'>22/22</span>
<span class='fraction'>44/48</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="strong">96.42% </span>
<span class="quiet">Functions</span>
<span class='fraction'>20/20</span>
<span class='fraction'>27/28</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="strong">96.73% </span>
<span class="quiet">Lines</span>
<span class='fraction'>70/70</span>
<span class='fraction'>89/92</span>
</div>
@@ -95,17 +95,17 @@
<tr>
<td class="file high" data-value="decorators"><a href="./decorators/index.html">decorators</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
<td data-value="98.11" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 98%"></div><div class="cover-empty" style="width: 2%"></div></div>
</td>
<td data-value="98.11" class="pct high">98.11%</td>
<td data-value="53" class="abs high">52/53</td>
<td data-value="89.18" class="pct medium">89.18%</td>
<td data-value="37" class="abs medium">33/37</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="39" class="abs high">39/39</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="11" class="abs high">11/11</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="10" class="abs high">10/10</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="39" class="abs high">39/39</td>
<td data-value="15" class="abs high">15/15</td>
<td data-value="98.07" class="pct high">98.07%</td>
<td data-value="52" class="abs high">51/52</td>
</tr>
<tr>
@@ -124,18 +124,18 @@
</tr>
<tr>
<td class="file high" data-value="interfaces"><a href="./interfaces/index.html">interfaces</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
<td class="file medium" data-value="interfaces"><a href="./interfaces/index.html">interfaces</a></td>
<td data-value="86.66" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 86%"></div><div class="cover-empty" style="width: 14%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">6/6</td>
<td data-value="86.66" class="pct medium">86.66%</td>
<td data-value="15" class="abs medium">13/15</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">6/6</td>
<td data-value="80" class="pct medium">80%</td>
<td data-value="5" class="abs medium">4/5</td>
<td data-value="86.66" class="pct medium">86.66%</td>
<td data-value="15" class="abs medium">13/15</td>
</tr>
</tbody>
@@ -146,7 +146,7 @@
<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-08-16T16:49:06.383Z
at 2024-08-22T22:17:58.876Z
</div>
<script src="./prettify.js"></script>
<script>

View File

@@ -23,9 +23,9 @@
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="strong">86.66% </span>
<span class="quiet">Statements</span>
<span class='fraction'>6/6</span>
<span class='fraction'>13/15</span>
</div>
@@ -37,16 +37,16 @@
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="strong">80% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/2</span>
<span class='fraction'>4/5</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="strong">86.66% </span>
<span class="quiet">Lines</span>
<span class='fraction'>6/6</span>
<span class='fraction'>13/15</span>
</div>
@@ -61,7 +61,7 @@
</div>
</template>
</div>
<div class='status-line high'></div>
<div class='status-line medium'></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>
@@ -93,7 +93,62 @@
<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></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<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></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>
@@ -104,8 +159,8 @@
<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">6x</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>
@@ -119,11 +174,65 @@
<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">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></td><td class="text"><pre class="prettyprint lang-js">import { ITSinjex } from './ITSinjex';
<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-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-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">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">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-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">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-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-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 { Identifier } from 'src/types/Identifier';
import { ITSinjex } from './ITSinjex';
&nbsp;
/**
* General error class for {@link ITSinjex} interface.
@@ -148,11 +257,64 @@ export class DependencyResolutionError extends TSinjexError {
* Creates a new instance of {@link DependencyResolutionError}
* @param identifier **The identifier of the dependency**
*/
constructor(identifier: string) {
super(`Dependency ${identifier} could not be resolved.`);
constructor(identifier: Identifier) {
super(`Dependency ${identifier.toString()} could not be resolved.`);
this.name = 'TSinjexResolutionError';
}
}
&nbsp;
/**
* Error class for Injector errors in {@link ITSinjex}.
* @see {@link ITSinjex.inject}
*/
export class InjectorError extends TSinjexError {
/**
* Creates a new instance of {@link InjectorError}
* @param identifier **The identifier of the dependency**
* @param originalError **The original error that caused the injection error**
*/
<span class="fstat-no" title="function not covered" > constructor(i</span>dentifier: Identifier, originalError?: Error) {
<span class="cstat-no" title="statement not covered" > super(</span>
`Error injecting dependency ${identifier.toString()} with error: "${originalError}"`,
);
<span class="cstat-no" title="statement not covered" > this.name = 'TSinjexInjectorError';</span>
}
}
&nbsp;
/**
* Error class for missing instantiation methods in {@link ITSinjex}.
* @see {@link ITSinjex.inject}
*/
export class NoInstantiationMethodError extends TSinjexError {
/**
* Creates a new instance of {@link NoInstantiationMethodError}
* @param identifier **The identifier of the dependency**
*/
constructor(identifier: Identifier) {
super(
`No instantiation method found for dependency ${identifier.toString()}.`,
);
this.name = 'TSinjexNoInstantiationMethodError';
}
}
&nbsp;
/**
* Error class for errors during the initialization of a dependency in {@link ITSinjex}.
* @see {@link ITSinjex.inject}
*/
export class InitializationError extends TSinjexError {
/**
* Creates a new instance of {@link InitializationError}
* @param identifier **The identifier of the dependency**
* @param originalError **The original error that caused the initialization error**
*/
constructor(identifier: Identifier, originalError?: Error) {
super(
`Error initializing dependency ${identifier.toString()} with error: "${originalError}"`,
);
this.name = 'TSinjexInitializationError';
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
@@ -160,7 +322,7 @@ export class DependencyResolutionError extends TSinjexError {
<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-08-16T16:49:06.383Z
at 2024-08-22T22:17:58.876Z
</div>
<script src="../prettify.js"></script>
<script>

View File

@@ -23,9 +23,9 @@
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="strong">86.66% </span>
<span class="quiet">Statements</span>
<span class='fraction'>6/6</span>
<span class='fraction'>13/15</span>
</div>
@@ -37,16 +37,16 @@
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="strong">80% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/2</span>
<span class='fraction'>4/5</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="strong">86.66% </span>
<span class="quiet">Lines</span>
<span class='fraction'>6/6</span>
<span class='fraction'>13/15</span>
</div>
@@ -61,7 +61,7 @@
</div>
</template>
</div>
<div class='status-line high'></div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
@@ -79,18 +79,18 @@
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="Exceptions.ts"><a href="./Exceptions.ts.html">Exceptions.ts</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
<td class="file medium" data-value="Exceptions.ts"><a href="./Exceptions.ts.html">Exceptions.ts</a></td>
<td data-value="86.66" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 86%"></div><div class="cover-empty" style="width: 14%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">6/6</td>
<td data-value="86.66" class="pct medium">86.66%</td>
<td data-value="15" class="abs medium">13/15</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">6/6</td>
<td data-value="80" class="pct medium">80%</td>
<td data-value="5" class="abs medium">4/5</td>
<td data-value="86.66" class="pct medium">86.66%</td>
<td data-value="15" class="abs medium">13/15</td>
</tr>
</tbody>
@@ -101,7 +101,7 @@
<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-08-16T16:49:06.383Z
at 2024-08-22T22:17:58.876Z
</div>
<script src="../prettify.js"></script>
<script>

View File

@@ -8,42 +8,42 @@ FN:93,(anonymous_4)
FN:107,(anonymous_5)
FNF:6
FNH:6
FNDA:16,(anonymous_0)
FNDA:33,(anonymous_1)
FNDA:22,(anonymous_0)
FNDA:45,(anonymous_1)
FNDA:2,(anonymous_2)
FNDA:4,(anonymous_3)
FNDA:11,(anonymous_4)
FNDA:18,(anonymous_5)
FNDA:17,(anonymous_4)
FNDA:24,(anonymous_5)
DA:6,3
DA:7,3
DA:25,3
DA:34,16
DA:48,33
DA:49,16
DA:52,33
DA:34,22
DA:48,45
DA:49,22
DA:52,45
DA:65,2
DA:80,4
DA:98,11
DA:108,18
DA:110,18
DA:98,17
DA:108,24
DA:110,24
DA:111,2
DA:112,16
DA:112,22
DA:113,1
DA:116,15
DA:116,21
DA:117,1
DA:120,1
DA:123,15
DA:123,21
LF:19
LH:19
BRDA:48,0,0,16
BRDA:48,0,0,22
BRDA:63,1,0,1
BRDA:78,2,0,3
BRDA:96,3,0,10
BRDA:96,3,0,16
BRDA:107,4,0,10
BRDA:110,5,0,2
BRDA:110,5,1,16
BRDA:110,6,0,18
BRDA:110,6,1,17
BRDA:110,5,1,22
BRDA:110,6,0,24
BRDA:110,6,1,21
BRDA:112,7,0,1
BRDA:116,8,0,1
BRF:11
@@ -51,41 +51,90 @@ BRH:11
end_of_record
TN:
SF:TSinjex/src/decorators/Inject.ts
FN:32,Inject
FN:37,(anonymous_1)
FN:45,(anonymous_2)
FN:51,(anonymous_3)
FNF:4
FNH:4
FNDA:4,Inject
FNDA:4,(anonymous_1)
FNDA:4,(anonymous_2)
FNDA:4,(anonymous_3)
FN:43,Inject
FN:48,(anonymous_1)
FN:54,(anonymous_2)
FN:59,(anonymous_3)
FN:63,(anonymous_4)
FN:72,(anonymous_5)
FN:74,(anonymous_6)
FN:121,tryAndCatch
FN:144,hasConstructor
FNF:9
FNH:9
FNDA:10,Inject
FNDA:10,(anonymous_1)
FNDA:10,(anonymous_2)
FNDA:10,(anonymous_3)
FNDA:10,(anonymous_4)
FNDA:2,(anonymous_5)
FNDA:1,(anonymous_6)
FNDA:13,tryAndCatch
FNDA:3,hasConstructor
DA:1,1
DA:32,1
DA:37,4
DA:39,4
DA:41,4
DA:45,4
DA:46,4
DA:50,4
DA:53,4
DA:54,4
DA:55,2
DA:56,2
DA:58,1
DA:59,1
DA:63,2
DA:67,2
LF:16
LH:16
BRDA:35,0,0,3
BRDA:53,1,0,4
BRDA:54,2,0,2
BRDA:54,2,1,2
BRDA:58,3,0,1
BRF:5
BRH:5
DA:7,1
DA:43,1
DA:48,10
DA:54,10
DA:55,10
DA:58,10
DA:62,10
DA:63,10
DA:69,9
DA:71,7
DA:72,2
DA:74,1
DA:77,7
DA:78,5
DA:79,3
DA:85,2
DA:86,1
DA:87,2
DA:88,1
DA:94,6
DA:101,6
DA:127,13
DA:128,13
DA:130,2
DA:131,2
DA:135,0
DA:145,3
DA:147,3
LF:29
LH:28
BRDA:46,0,0,7
BRDA:69,1,0,7
BRDA:69,1,1,2
BRDA:71,2,0,2
BRDA:71,2,1,5
BRDA:71,3,0,7
BRDA:71,3,1,2
BRDA:73,4,0,1
BRDA:73,4,1,4
BRDA:73,5,0,5
BRDA:73,5,1,3
BRDA:77,6,0,2
BRDA:77,6,1,5
BRDA:78,7,0,3
BRDA:78,7,1,2
BRDA:85,8,0,1
BRDA:87,9,0,1
BRDA:130,10,0,2
BRDA:130,10,1,0
BRDA:131,11,0,2
BRDA:131,11,1,0
BRDA:132,12,0,2
BRDA:132,12,1,0
BRDA:132,13,0,2
BRDA:132,13,1,2
BRDA:148,14,0,3
BRDA:148,14,1,1
BRDA:148,15,0,0
BRDA:148,15,1,3
BRDA:148,16,0,3
BRDA:148,16,1,3
BRF:31
BRH:27
end_of_record
TN:
SF:TSinjex/src/decorators/Register.ts
@@ -176,20 +225,35 @@ BRH:0
end_of_record
TN:
SF:TSinjex/src/interfaces/Exceptions.ts
FN:11,(anonymous_0)
FN:26,(anonymous_1)
FNF:2
FNH:2
FNDA:2,(anonymous_0)
FNDA:2,(anonymous_1)
DA:6,3
DA:12,2
DA:13,2
DA:21,3
DA:27,2
DA:28,2
LF:6
LH:6
FN:12,(anonymous_0)
FN:27,(anonymous_1)
FN:43,(anonymous_2)
FN:60,(anonymous_3)
FN:78,(anonymous_4)
FNF:5
FNH:4
FNDA:6,(anonymous_0)
FNDA:4,(anonymous_1)
FNDA:0,(anonymous_2)
FNDA:1,(anonymous_3)
FNDA:1,(anonymous_4)
DA:7,3
DA:13,6
DA:14,6
DA:22,3
DA:28,4
DA:29,4
DA:37,3
DA:44,0
DA:47,0
DA:55,3
DA:61,1
DA:64,1
DA:72,3
DA:79,1
DA:82,1
LF:15
LH:13
BRF:0
BRH:0
end_of_record