mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
add Merge (without Fork). Add flowcontrol setter to Operation
This commit is contained in:
parent
72d943aca2
commit
bca73b496f
5 changed files with 353 additions and 298 deletions
46
src/core/operations/Merge.mjs
Normal file
46
src/core/operations/Merge.mjs
Normal file
|
@ -0,0 +1,46 @@
|
|||
/**
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import Operation from "../Operation";
|
||||
|
||||
/**
|
||||
* Merge operation
|
||||
*/
|
||||
class Merge extends Operation {
|
||||
|
||||
/**
|
||||
* Merge constructor
|
||||
*/
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.name = "Merge";
|
||||
this.flowControl = true;
|
||||
this.module = "Default";
|
||||
this.description = "Consolidate all branches back into a single trunk. The opposite of Fork.";
|
||||
this.inputType = "string";
|
||||
this.outputType = "string";
|
||||
this.args = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge operation.
|
||||
*
|
||||
* @param {Object} state - The current state of the recipe.
|
||||
* @param {number} state.progress - The current position in the recipe.
|
||||
* @param {Dish} state.dish - The Dish being operated on.
|
||||
* @param {Operation[]} state.opList - The list of operations in the recipe.
|
||||
* @returns {Object} The updated state of the recipe.
|
||||
*/
|
||||
run(state) {
|
||||
// No need to actually do anything here. The fork operation will
|
||||
// merge when it sees this operation.
|
||||
return state;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default Merge;
|
Loading…
Add table
Add a link
Reference in a new issue