Sha256: 4693ffaacca79e3914a294b3ea9dd780ca630e22168348adef75ea5ef887ba3c
Contents?: true
Size: 854 Bytes
Versions: 12
Compression:
Stored size: 854 Bytes
Contents
'use strict'; var $ = require('../internals/export'); var IS_PURE = require('../internals/is-pure'); var anObject = require('../internals/an-object'); var bind = require('../internals/bind-context'); var getMapIterator = require('../internals/get-map-iterator'); var iterate = require('../internals/iterate'); // `Map.prototype.findKey` method // https://github.com/tc39/proposal-collection-methods $({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { findKey: function findKey(callbackfn /* , thisArg */) { var map = anObject(this); var iterator = getMapIterator(map); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); return iterate(iterator, function (key, value) { if (boundFunction(value, key, map)) return iterate.stop(key); }, undefined, true, true).result; } });
Version data entries
12 entries across 12 versions & 4 rubygems