CyberChef/src/core/lib/FlowControl.mjs

14 lines
314 B
JavaScript
Raw Normal View History

2018-05-18 13:50:23 +02:00
/**
* Returns the index of a label.
*
* @private
* @param {Object} state
* @param {string} name
* @returns {number}
*/
export function getLabelIndex(name, state) {
return state.opList.findIndex((operation) => {
return (operation.name === "Label") && (name === operation.ingValues[0]);
});
}