It doesn't look like there is a way to end eachMapping early.
We have some code that searches through the mappings for a 'bad' mapping. We want to exit the function early at that point, instead of continuing through all the other mappings.
Would you accept a PR to add this functionality? Could be implemented as:
- a
done callback
- or
return false to stop the iteration
- or
return END_ITERATION where END_ITERATION is defined as a special value {}. This has better backwards-compatibility than returning false.
It doesn't look like there is a way to end
eachMappingearly.We have some code that searches through the mappings for a 'bad' mapping. We want to exit the function early at that point, instead of continuing through all the other mappings.
Would you accept a PR to add this functionality? Could be implemented as:
donecallbackreturn falseto stop the iterationreturn END_ITERATIONwhereEND_ITERATIONis defined as a special value{}. This has better backwards-compatibility than returningfalse.