Sha256: b8c31a823d9f5cd3f737ac968284e630ccd44eb4c6e6c5d7b5a0a99eca30bb1d

Contents?: true

Size: 758 Bytes

Versions: 40

Compression:

Stored size: 758 Bytes

Contents

'use strict';

var ArraySpeciesCreate = require('es-abstract/2023/ArraySpeciesCreate');
var FlattenIntoArray = require('es-abstract/2023/FlattenIntoArray');
var Get = require('es-abstract/2023/Get');
var IsCallable = require('es-abstract/2023/IsCallable');
var ToLength = require('es-abstract/2023/ToLength');
var ToObject = require('es-abstract/2023/ToObject');

module.exports = function flatMap(mapperFunction) {
	var O = ToObject(this);
	var sourceLen = ToLength(Get(O, 'length'));

	if (!IsCallable(mapperFunction)) {
		throw new TypeError('mapperFunction must be a function');
	}

	var T;
	if (arguments.length > 1) {
		T = arguments[1];
	}

	var A = ArraySpeciesCreate(O, 0);
	FlattenIntoArray(A, O, sourceLen, 0, 1, mapperFunction, T);
	return A;
};

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
immosquare-cleaner-0.1.51 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.50 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.49 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.48 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.47 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.46 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.45 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.44 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.43 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.42 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.41 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.40 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.39 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.38 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.32 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.31 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.30 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.29 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.28 node_modules/array.prototype.flatmap/implementation.js
immosquare-cleaner-0.1.27 node_modules/array.prototype.flatmap/implementation.js