source: trip-planner-front/node_modules/core-js/modules/esnext.map.map-keys.js@ 571e0df

Last change on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.1 KB
Line 
1'use strict';
2var $ = require('../internals/export');
3var IS_PURE = require('../internals/is-pure');
4var getBuiltIn = require('../internals/get-built-in');
5var anObject = require('../internals/an-object');
6var aFunction = require('../internals/a-function');
7var bind = require('../internals/function-bind-context');
8var speciesConstructor = require('../internals/species-constructor');
9var getMapIterator = require('../internals/get-map-iterator');
10var iterate = require('../internals/iterate');
11
12// `Map.prototype.mapKeys` method
13// https://github.com/tc39/proposal-collection-methods
14$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
15 mapKeys: function mapKeys(callbackfn /* , thisArg */) {
16 var map = anObject(this);
17 var iterator = getMapIterator(map);
18 var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
19 var newMap = new (speciesConstructor(map, getBuiltIn('Map')))();
20 var setter = aFunction(newMap.set);
21 iterate(iterator, function (key, value) {
22 setter.call(newMap, boundFunction(value, key, map), value);
23 }, { AS_ENTRIES: true, IS_ITERATOR: true });
24 return newMap;
25 }
26});
Note: See TracBrowser for help on using the repository browser.