Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

map-iterate.js 606B

12345678910111213141516
  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. var Map = MapHelpers.Map;
  6. var MapPrototype = MapHelpers.proto;
  7. var forEach = uncurryThis(MapPrototype.forEach);
  8. var entries = uncurryThis(MapPrototype.entries);
  9. var next = entries(new Map()).next;
  10. module.exports = function (map, fn, interruptible) {
  11. return interruptible ? iterateSimple({ iterator: entries(map), next: next }, function (entry) {
  12. return fn(entry[1], entry[0]);
  13. }) : forEach(map, fn);
  14. };