chore: lint

This commit is contained in:
karishmas6
2024-06-05 04:36:22 +05:30
parent 649de7e9f6
commit bf861fad2b

View File

@@ -17,7 +17,7 @@ export class WorkflowInterpreter {
* Socket.io socket instance enabling communication with the client (frontend) side. * Socket.io socket instance enabling communication with the client (frontend) side.
* @private * @private
*/ */
private socket : Socket; private socket: Socket;
/** /**
* True if the interpretation is paused. * True if the interpretation is paused.
@@ -50,7 +50,7 @@ export class WorkflowInterpreter {
/** /**
* An array of all the binary data extracted from the run. * An array of all the binary data extracted from the run.
*/ */
public binaryData: {mimetype: string, data: string}[] = []; public binaryData: { mimetype: string, data: string }[] = [];
/** /**
* An array of id's of the pairs from the workflow that are about to be paused. * An array of id's of the pairs from the workflow that are about to be paused.
@@ -70,7 +70,7 @@ export class WorkflowInterpreter {
* @param socket Socket.io socket instance enabling communication with the client (frontend) side. * @param socket Socket.io socket instance enabling communication with the client (frontend) side.
* @constructor * @constructor
*/ */
constructor (socket: Socket) { constructor(socket: Socket) {
this.socket = socket; this.socket = socket;
} }
@@ -90,7 +90,7 @@ export class WorkflowInterpreter {
this.interpretationResume(); this.interpretationResume();
this.socket.emit('log', '----- The interpretation has been resumed -----', false); this.socket.emit('log', '----- The interpretation has been resumed -----', false);
} else { } else {
logger.log('debug',"Resume called but no resume function is set"); logger.log('debug', "Resume called but no resume function is set");
} }
}); });
this.socket.on('step', () => { this.socket.on('step', () => {
@@ -139,7 +139,7 @@ export class WorkflowInterpreter {
this.socket.emit('serializableCallback', data); this.socket.emit('serializableCallback', data);
}, },
binaryCallback: (data: string, mimetype: string) => { binaryCallback: (data: string, mimetype: string) => {
this.socket.emit('binaryCallback', {data, mimetype}); this.socket.emit('binaryCallback', { data, mimetype });
} }
} }
@@ -148,14 +148,14 @@ export class WorkflowInterpreter {
interpreter.on('flag', async (page, resume) => { interpreter.on('flag', async (page, resume) => {
if (this.activeId !== null && this.breakpoints[this.activeId]) { if (this.activeId !== null && this.breakpoints[this.activeId]) {
logger.log('debug',`breakpoint hit id: ${this.activeId}`); logger.log('debug', `breakpoint hit id: ${this.activeId}`);
this.socket.emit('breakpointHit'); this.socket.emit('breakpointHit');
this.interpretationIsPaused = true; this.interpretationIsPaused = true;
} }
if (this.interpretationIsPaused) { if (this.interpretationIsPaused) {
this.interpretationResume = resume; this.interpretationResume = resume;
logger.log('debug',`Paused inside of flag: ${page.url()}`); logger.log('debug', `Paused inside of flag: ${page.url()}`);
updatePageOnPause(page); updatePageOnPause(page);
this.socket.emit('log', '----- The interpretation has been paused -----', false); this.socket.emit('log', '----- The interpretation has been paused -----', false);
} else { } else {
@@ -169,7 +169,7 @@ export class WorkflowInterpreter {
this.socket.emit('log', `----- The interpretation finished with status: ${status} -----`, false); this.socket.emit('log', `----- The interpretation finished with status: ${status} -----`, false);
logger.log('debug',`Interpretation finished`); logger.log('debug', `Interpretation finished`);
this.interpreter = null; this.interpreter = null;
this.socket.emit('activePairId', -1); this.socket.emit('activePairId', -1);
this.interpretationIsPaused = false; this.interpretationIsPaused = false;
@@ -229,8 +229,8 @@ export class WorkflowInterpreter {
this.socket.emit('serializableCallback', data); this.socket.emit('serializableCallback', data);
}, },
binaryCallback: async (data: string, mimetype: string) => { binaryCallback: async (data: string, mimetype: string) => {
this.binaryData.push({mimetype, data: JSON.stringify(data)}); this.binaryData.push({ mimetype, data: JSON.stringify(data) });
this.socket.emit('binaryCallback', {data, mimetype}); this.socket.emit('binaryCallback', { data, mimetype });
} }
} }
@@ -256,7 +256,7 @@ export class WorkflowInterpreter {
}, {}) }, {})
} }
logger.log('debug',`Interpretation finished`); logger.log('debug', `Interpretation finished`);
this.clearState(); this.clearState();
return result; return result;
} }
@@ -274,7 +274,7 @@ export class WorkflowInterpreter {
* @param socket Socket.io socket instance enabling communication with the client (frontend) side. * @param socket Socket.io socket instance enabling communication with the client (frontend) side.
* @returns void * @returns void
*/ */
public updateSocket = (socket: Socket) : void => { public updateSocket = (socket: Socket): void => {
this.socket = socket; this.socket = socket;
this.subscribeToPausing(); this.subscribeToPausing();
}; };