Deploy documentation and coverage
This commit is contained in:
@@ -30,9 +30,9 @@
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">87.09% </span>
|
||||
<span class="strong">88% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>27/31</span>
|
||||
<span class='fraction'>22/25</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -215,11 +215,6 @@
|
||||
<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"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -256,6 +251,11 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
@@ -365,15 +365,15 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import {
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { TSinjex } from '../classes/TSinjex.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';
|
||||
} from '../interfaces/Exceptions.js';
|
||||
import { Identifier } from '../types/Identifier.js';
|
||||
import { InitDelegate } from '../types/InitDelegate.js';
|
||||
|
||||
/**
|
||||
* A decorator to inject a dependency from a DI (Dependency Injection) container into a class property.
|
||||
@@ -384,7 +384,7 @@ import { InitDelegate } from '../types/InitDelegate';
|
||||
* @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.
|
||||
* @param isNecessary 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 **Only throws errors if the dependency is necessary.**
|
||||
@@ -410,7 +410,7 @@ import { InitDelegate } from '../types/InitDelegate';
|
||||
export function Inject<T, U>(
|
||||
identifier: Identifier,
|
||||
init?: InitDelegate<T, U> | true,
|
||||
necessary = true,
|
||||
isNecessary = true,
|
||||
) {
|
||||
return function (target: unknown, propertyKey: string | symbol): void {
|
||||
/**
|
||||
@@ -419,7 +419,7 @@ export function Inject<T, U>(
|
||||
* @returns The resolved dependency or undefined if the dependency is not found.
|
||||
*/
|
||||
const resolve = (): T | undefined => {
|
||||
return TSinjex.getInstance().resolve<T>(identifier, necessary);
|
||||
return TSinjex.getInstance().resolve<T>(identifier, isNecessary);
|
||||
};
|
||||
|
||||
Object.defineProperty(target, propertyKey, {
|
||||
@@ -428,7 +428,7 @@ export function Inject<T, U>(
|
||||
|
||||
const dependency: T | undefined = tryAndCatch(
|
||||
() => resolve(),
|
||||
necessary,
|
||||
isNecessary,
|
||||
identifier,
|
||||
DependencyResolutionError,
|
||||
);
|
||||
@@ -445,13 +445,13 @@ export function Inject<T, U>(
|
||||
else if (initFunction != null)
|
||||
instance = tryAndCatch(
|
||||
initFunction,
|
||||
necessary,
|
||||
isNecessary,
|
||||
identifier,
|
||||
InitializationError,
|
||||
);
|
||||
else if (necessary)
|
||||
else if (isNecessary)
|
||||
throw new NoInstantiationMethodError(identifier);
|
||||
} else if (necessary)
|
||||
} else if (isNecessary)
|
||||
throw new DependencyResolutionError(identifier);
|
||||
|
||||
/**
|
||||
@@ -512,7 +512,7 @@ function hasConstructor<T>(obj: T): obj is T & { new (): unknown } {
|
||||
const _obj = obj as unknown as { prototype?: { constructor?: unknown } };
|
||||
|
||||
return (
|
||||
_obj<span class="branch-0 cbranch-no" title="branch not covered" >?.p</span>rototype != null &&
|
||||
_obj?.prototype != null &&
|
||||
typeof _obj.prototype.constructor === 'function'
|
||||
);
|
||||
}
|
||||
@@ -523,7 +523,7 @@ function hasConstructor<T>(obj: T): obj is T & { new (): unknown } {
|
||||
<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 2025-04-02T18:22:41.239Z
|
||||
at 2025-04-02T19:53:14.343Z
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
<script>
|
||||
|
@@ -595,9 +595,9 @@
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">12x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { InitDelegate } from 'src/types/InitDelegate';
|
||||
import { TSinjex } from '../classes/TSinjex';
|
||||
import { Identifier } from '../types/Identifier';
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { InitDelegate } from 'src/types/InitDelegate.js';
|
||||
import { TSinjex } from '../classes/TSinjex.js';
|
||||
import { Identifier } from '../types/Identifier.js';
|
||||
|
||||
//#region Overloads
|
||||
|
||||
@@ -868,7 +868,7 @@ function initializeInstance<
|
||||
<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 2025-04-02T18:22:41.239Z
|
||||
at 2025-04-02T19:53:14.343Z
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
<script>
|
||||
|
@@ -141,9 +141,9 @@
|
||||
<span class="cline-any cline-yes">4x</span>
|
||||
<span class="cline-any cline-yes">2x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { Register } from './Register';
|
||||
import { Identifier } from '../types/Identifier';
|
||||
import { InitDelegate } from '../types/InitDelegate';
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { Register } from './Register.js';
|
||||
import { Identifier } from '../types/Identifier.js';
|
||||
import { InitDelegate } from '../types/InitDelegate.js';
|
||||
|
||||
/**
|
||||
* A decorator to register an instance of a class in the DI (Dependency Injection) container.
|
||||
@@ -187,7 +187,7 @@ export function RegisterInstance<
|
||||
<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 2025-04-02T18:22:41.239Z
|
||||
at 2025-04-02T19:53:14.343Z
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
<script>
|
||||
|
@@ -30,9 +30,9 @@
|
||||
|
||||
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">89.13% </span>
|
||||
<span class="strong">90% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>41/46</span>
|
||||
<span class='fraction'>36/40</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -85,8 +85,8 @@
|
||||
</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="88" class="pct medium">88%</td>
|
||||
<td data-value="25" class="abs medium">22/25</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="9" class="abs high">9/9</td>
|
||||
<td data-value="96.55" class="pct high">96.55%</td>
|
||||
@@ -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 2025-04-02T18:22:41.239Z
|
||||
at 2025-04-02T19:53:14.343Z
|
||||
</div>
|
||||
<script src="../prettify.js"></script>
|
||||
<script>
|
||||
|
Reference in New Issue
Block a user