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 {AbstractFactory} from "./AbstractFactory";
import {DependencyRequirement, PropertyDependency, StaticClass} from "../types";
import {Collection} from "../../util";
import {AbstractFactory} from './AbstractFactory'
import {DependencyKey, DependencyRequirement, PropertyDependency} from '../types'
import {Collection} from '../../util'
/**
* A factory whose token is produced by calling a function.
@@ -17,19 +17,19 @@ import {Collection} from "../../util";
* fact.produce([], []) // => 4
* ```
*/
export class ClosureFactory extends AbstractFactory {
export class ClosureFactory<T> extends AbstractFactory<T> {
constructor(
protected readonly name: string | StaticClass<any, any>,
protected readonly token: () => any,
protected readonly name: DependencyKey,
protected readonly token: () => T,
) {
super(token)
}
produce(dependencies: any[], parameters: any[]): any {
produce(): any {
return this.token()
}
match(something: any) {
match(something: unknown): boolean {
return something === this.name
}