Last change
on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
380 bytes
|
Line | |
---|
1 | var anObject = require('../internals/an-object');
|
---|
2 | var iteratorClose = require('../internals/iterator-close');
|
---|
3 |
|
---|
4 | // call something on iterator step with safe closing on error
|
---|
5 | module.exports = function (iterator, fn, value, ENTRIES) {
|
---|
6 | try {
|
---|
7 | return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
---|
8 | } catch (error) {
|
---|
9 | iteratorClose(iterator);
|
---|
10 | throw error;
|
---|
11 | }
|
---|
12 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.