Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

esnext.map.key-of.js 510B

123456789101112131415
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var aMap = require('../internals/a-map');
  4. var iterate = require('../internals/map-iterate');
  5. // `Map.prototype.keyOf` method
  6. // https://github.com/tc39/proposal-collection-methods
  7. $({ target: 'Map', proto: true, real: true, forced: true }, {
  8. keyOf: function keyOf(searchElement) {
  9. var result = iterate(aMap(this), function (value, key) {
  10. if (value === searchElement) return { key: key };
  11. }, true);
  12. return result && result.key;
  13. }
  14. });