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.

collection-of.js 458B

123456789101112131415
  1. 'use strict';
  2. var anObject = require('../internals/an-object');
  3. // https://tc39.github.io/proposal-setmap-offrom/
  4. module.exports = function (C, adder, ENTRY) {
  5. return function of() {
  6. var result = new C();
  7. var length = arguments.length;
  8. for (var index = 0; index < length; index++) {
  9. var entry = arguments[index];
  10. if (ENTRY) adder(result, anObject(entry)[0], entry[1]);
  11. else adder(result, entry);
  12. } return result;
  13. };
  14. };