main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
606 bytes
|
Rev | Line | |
---|
[79a0317] | 1 | 'use strict';
|
---|
| 2 | var uncurryThis = require('../internals/function-uncurry-this');
|
---|
| 3 | var iterateSimple = require('../internals/iterate-simple');
|
---|
| 4 | var MapHelpers = require('../internals/map-helpers');
|
---|
| 5 |
|
---|
| 6 | var Map = MapHelpers.Map;
|
---|
| 7 | var MapPrototype = MapHelpers.proto;
|
---|
| 8 | var forEach = uncurryThis(MapPrototype.forEach);
|
---|
| 9 | var entries = uncurryThis(MapPrototype.entries);
|
---|
| 10 | var next = entries(new Map()).next;
|
---|
| 11 |
|
---|
| 12 | module.exports = function (map, fn, interruptible) {
|
---|
| 13 | return interruptible ? iterateSimple({ iterator: entries(map), next: next }, function (entry) {
|
---|
| 14 | return fn(entry[1], entry[0]);
|
---|
| 15 | }) : forEach(map, fn);
|
---|
| 16 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.