massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / modules / esnext.map.map-values.js
1 'use strict';
2 var IS_PURE = require('../internals/is-pure');
3 var $ = require('../internals/export');
4 var getBuiltIn = require('../internals/get-built-in');
5 var bind = require('../internals/function-bind-context');
6 var call = require('../internals/function-call');
7 var aCallable = require('../internals/a-callable');
8 var anObject = require('../internals/an-object');
9 var speciesConstructor = require('../internals/species-constructor');
10 var getMapIterator = require('../internals/get-map-iterator');
11 var iterate = require('../internals/iterate');
12
13 // `Map.prototype.mapValues` method
14 // https://github.com/tc39/proposal-collection-methods
15 $({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
16   mapValues: function mapValues(callbackfn /* , thisArg */) {
17     var map = anObject(this);
18     var iterator = getMapIterator(map);
19     var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
20     var newMap = new (speciesConstructor(map, getBuiltIn('Map')))();
21     var setter = aCallable(newMap.set);
22     iterate(iterator, function (key, value) {
23       call(setter, newMap, key, boundFunction(value, key, map));
24     }, { AS_ENTRIES: true, IS_ITERATOR: true });
25     return newMap;
26   }
27 });