FlowControl.mjs 314 B

12345678910111213
  1. /**
  2. * Returns the index of a label.
  3. *
  4. * @private
  5. * @param {Object} state
  6. * @param {string} name
  7. * @returns {number}
  8. */
  9. export function getLabelIndex(name, state) {
  10. return state.opList.findIndex((operation) => {
  11. return (operation.name === "Label") && (name === operation.ingValues[0]);
  12. });
  13. }