Last change
on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
675 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var $ = require('../internals/export');
|
---|
3 | var IS_PURE = require('../internals/is-pure');
|
---|
4 | var anObject = require('../internals/an-object');
|
---|
5 | var getMapIterator = require('../internals/get-map-iterator');
|
---|
6 | var iterate = require('../internals/iterate');
|
---|
7 |
|
---|
8 | // `Map.prototype.includes` method
|
---|
9 | // https://github.com/tc39/proposal-collection-methods
|
---|
10 | $({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
|
---|
11 | keyOf: function keyOf(searchElement) {
|
---|
12 | return iterate(getMapIterator(anObject(this)), function (key, value, stop) {
|
---|
13 | if (value === searchElement) return stop(key);
|
---|
14 | }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).result;
|
---|
15 | }
|
---|
16 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.