Setup eslint and enforce rules
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-06-02 22:36:25 -05:00
parent 82e7a1f299
commit 1d5056b753
149 changed files with 6104 additions and 3114 deletions

View File

@@ -1,6 +1,6 @@
import { Factory } from './Factory'
import { Collection } from '../../util'
import {DependencyRequirement, PropertyDependency} from "../types";
import {DependencyKey, DependencyRequirement, PropertyDependency} from '../types'
/**
* Container factory which returns its token as its value, without attempting
@@ -19,29 +19,23 @@ import {DependencyRequirement, PropertyDependency} from "../types";
*
* @extends Factory
*/
export default class SingletonFactory extends Factory {
export default class SingletonFactory<T> extends Factory<T> {
constructor(
/**
* Instantiated value of this factory.
* @type FunctionConstructor
* Token identifying this singleton.
*/
protected token: FunctionConstructor,
protected token: DependencyKey,
/**
* String name of this singleton identifying it in the container.
* @type string
* The value of this singleton.
*/
protected key: string,
protected value: T,
) {
super(token)
}
produce(dependencies: any[], parameters: any[]) {
return this.token
}
match(something: any) {
return something === this.key
produce(): T {
return this.value
}
getDependencyKeys(): Collection<DependencyRequirement> {