fix(core): update

This commit is contained in:
2021-09-26 14:45:02 +02:00
parent 8f9b3151d8
commit c367f0f949
9 changed files with 20310 additions and 3785 deletions

View File

@ -8,7 +8,7 @@ export class BufferRunner {
this.task = taskArg;
}
public trigger(x): Promise<any> {
public trigger(x: any): Promise<any> {
if (!(this.bufferCounter >= this.task.bufferMax)) {
this.bufferCounter++;
}
@ -21,8 +21,8 @@ export class BufferRunner {
return returnPromise;
}
private _run(x) {
const recursiveBufferRunner = (x) => {
private _run(x: any) {
const recursiveBufferRunner = (x: any) => {
if (this.bufferCounter >= 0) {
this.task.running = true;
Task.runTask(this.task, { x: x }).then((x) => {

View File

@ -21,7 +21,7 @@ export class CycleCounter {
this.cycleObjectArray.push(cycleObject);
return done.promise;
}
public informOfCycle(x) {
public informOfCycle(x: any) {
const newCycleObjectArray: ICycleObject[] = [];
this.cycleObjectArray.forEach((cycleObjectArg) => {
cycleObjectArg.cycleCounter--;

View File

@ -56,7 +56,7 @@ export class Task {
public static runTask = async (
taskArg: Task | TPreOrAfterTaskFunction,
optionsArg: { x?; touchedTasksArray?: Task[] }
optionsArg: { x?: any; touchedTasksArray?: Task[] }
) => {
const taskToRun = Task.extractTask(taskArg);
const done = plugins.smartpromise.defer();
@ -190,7 +190,7 @@ export class Task {
/**
* trigger the task. Will trigger buffered if this.buffered is true
*/
public trigger(x?): Promise<any> {
public trigger(x?: any): Promise<any> {
if (this.buffered) {
return this.triggerBuffered(x);
} else {
@ -202,7 +202,7 @@ export class Task {
* trigger task unbuffered.
* will actually run the task, not considering any buffered limits.
*/
public triggerUnBuffered(x?): Promise<any> {
public triggerUnBuffered(x?: any): Promise<any> {
return Task.runTask(this, { x: x });
}
@ -210,7 +210,7 @@ export class Task {
* trigger task buffered.
* will simply call task.trigger(), which respects buffering by default
*/
public triggerBuffered(x?): Promise<any> {
public triggerBuffered(x?: any): Promise<any> {
return this.bufferRunner.trigger(x);
}

View File

@ -25,7 +25,7 @@ export class Taskchain extends Task {
// this is the function that gets executed when TaskChain is triggered
const done = plugins.smartpromise.defer(); // this is the starting Deferred object
let taskCounter = 0; // counter for iterating async over the taskArray
const iterateTasks = (x) => {
const iterateTasks = (x: any) => {
if (typeof this.taskArray[taskCounter] !== 'undefined') {
console.log(this.name + ' running: Task' + this.taskArray[taskCounter].name);
this.taskArray[taskCounter].trigger(x).then((x) => {

View File

@ -20,8 +20,8 @@ export class TaskManager {
* checks if a task is already present
* @param taskNameArg
*/
public getTaskByName(taskNameArg): Task {
return this.taskMap.find((itemArg) => {
public getTaskByName(taskNameArg: string): Task {
return this.taskMap.findSync((itemArg) => {
return itemArg.name === taskNameArg;
});
}