Fix circular dependencies in migrator
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -23,6 +23,16 @@ export function isInstantiable<T>(what: unknown): what is Instantiable<T> {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given value is instantiable and, once instantiated,
|
||||
* will create an instance of the given static class.
|
||||
* @param what
|
||||
* @param type
|
||||
*/
|
||||
export function isInstantiableOf<T>(what: unknown, type: StaticClass<T, any>): what is Instantiable<T> {
|
||||
return isInstantiable(what) && what.prototype instanceof type
|
||||
}
|
||||
|
||||
/**
|
||||
* Type that identifies a value as a static class, even if it is not instantiable.
|
||||
*/
|
||||
@@ -41,6 +51,11 @@ export function isStaticClass<T, T2>(something: unknown): something is StaticCla
|
||||
*/
|
||||
export type DependencyKey = Instantiable<any> | StaticClass<any, any> | string
|
||||
|
||||
/**
|
||||
* A DependencyKey, but typed
|
||||
*/
|
||||
export type TypedDependencyKey<T> = Instantiable<T> | StaticClass<T, any> | string
|
||||
|
||||
/**
|
||||
* Interface used to store dependency requirements by their place in the injectable
|
||||
* target's parameters.
|
||||
@@ -58,6 +73,7 @@ export interface DependencyRequirement {
|
||||
export interface PropertyDependency {
|
||||
key: DependencyKey,
|
||||
property: string | symbol,
|
||||
debug?: boolean,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user