Setup eslint and enforce rules
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -45,15 +45,15 @@ export class Pipe<T> {
|
||||
* Return a new Pipe containing the given subject.
|
||||
* @param subject
|
||||
*/
|
||||
static wrap<subject_t>(subject: subject_t) {
|
||||
return new Pipe<subject_t>(subject)
|
||||
static wrap<subjectType>(subject: subjectType): Pipe<subjectType> {
|
||||
return new Pipe<subjectType>(subject)
|
||||
}
|
||||
|
||||
constructor(
|
||||
/**
|
||||
* The item being operated on.
|
||||
*/
|
||||
private subject: T
|
||||
private subject: T,
|
||||
) {}
|
||||
|
||||
/**
|
||||
@@ -68,7 +68,7 @@ export class Pipe<T> {
|
||||
*
|
||||
* @param op
|
||||
*/
|
||||
tap<T2>(op: PipeOperator<T, T2>) {
|
||||
tap<T2>(op: PipeOperator<T, T2>): Pipe<T2> {
|
||||
return new Pipe(op(this.subject))
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ export class Pipe<T> {
|
||||
* @param check
|
||||
* @param op
|
||||
*/
|
||||
when(check: boolean, op: ReflexivePipeOperator<T>) {
|
||||
when(check: boolean, op: ReflexivePipeOperator<T>): Pipe<T> {
|
||||
if ( check ) {
|
||||
return Pipe.wrap(op(this.subject))
|
||||
}
|
||||
@@ -94,7 +94,7 @@ export class Pipe<T> {
|
||||
* @param check
|
||||
* @param op
|
||||
*/
|
||||
unless(check: boolean, op: ReflexivePipeOperator<T>) {
|
||||
unless(check: boolean, op: ReflexivePipeOperator<T>): Pipe<T> {
|
||||
return this.when(!check, op)
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ export class Pipe<T> {
|
||||
* @param check
|
||||
* @param op
|
||||
*/
|
||||
whenNot(check: boolean, op: ReflexivePipeOperator<T>) {
|
||||
whenNot(check: boolean, op: ReflexivePipeOperator<T>): Pipe<T> {
|
||||
return this.unless(check, op)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user