Sha256: 5be8299daf30cde7eb1e2f93031b15ae3b8bb2057726e5f26a23a570a7c3bb11

Contents?: true

Size: 802 Bytes

Versions: 66

Compression:

Stored size: 802 Bytes

Contents

'use strict';
// https://tc39.github.io/proposal-setmap-offrom/
var $export = require('./_export');
var aFunction = require('./_a-function');
var ctx = require('./_ctx');
var forOf = require('./_for-of');

module.exports = function (COLLECTION) {
  $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
    var mapFn = arguments[1];
    var mapping, A, n, cb;
    aFunction(this);
    mapping = mapFn !== undefined;
    if (mapping) aFunction(mapFn);
    if (source == undefined) return new this();
    A = [];
    if (mapping) {
      n = 0;
      cb = ctx(mapFn, arguments[2], 2);
      forOf(source, false, function (nextItem) {
        A.push(cb(nextItem, n++));
      });
    } else {
      forOf(source, false, A.push, A);
    }
    return new this(A);
  } });
};

Version data entries

66 entries across 30 versions & 8 rubygems

Version Path
condenser-0.0.5 lib/condenser/processors/node_modules/core-js/library/modules/_set-collection-from.js
condenser-0.0.5 lib/condenser/processors/node_modules/core-js/modules/_set-collection-from.js
optimacms-0.4.3 spec/dummy/node_modules/core-js/library/modules/_set-collection-from.js
optimacms-0.4.3 spec/dummy/node_modules/core-js/modules/_set-collection-from.js
optimacms-0.4.2 spec/dummy/node_modules/core-js/modules/_set-collection-from.js
optimacms-0.4.2 spec/dummy/node_modules/core-js/library/modules/_set-collection-from.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/core-js/library/modules/_set-collection-from.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/core-js/modules/_set-collection-from.js
lux_assets-0.2.11 ./node_modules/core-js/library/modules/_set-collection-from.js
lux_assets-0.2.11 ./node_modules/core-js/modules/_set-collection-from.js
lux_assets-0.2.9 ./node_modules/core-js/modules/_set-collection-from.js
lux_assets-0.2.9 ./node_modules/core-js/library/modules/_set-collection-from.js
lux_assets-0.2.4 ./node_modules/core-js/library/modules/_set-collection-from.js
lux_assets-0.2.4 ./node_modules/core-js/modules/_set-collection-from.js
lux_assets-0.2.2 ./node_modules/core-js/library/modules/_set-collection-from.js
lux_assets-0.2.2 ./node_modules/core-js/modules/_set-collection-from.js
lux_assets-0.2.1 ./node_modules/core-js/modules/_set-collection-from.js
lux_assets-0.2.1 ./node_modules/core-js/library/modules/_set-collection-from.js
locomotivecms-3.4.0 app/javascript/node_modules/core-js/modules/_set-collection-from.js
locomotivecms-3.4.0 app/javascript/node_modules/core-js/library/modules/_set-collection-from.js