a-map.js 383 B

12345678910
  1. 'use strict';
  2. var tryToString = require('../internals/try-to-string');
  3. var $TypeError = TypeError;
  4. // Perform ? RequireInternalSlot(M, [[MapData]])
  5. module.exports = function (it) {
  6. if (typeof it == 'object' && 'size' in it && 'has' in it && 'get' in it && 'set' in it && 'delete' in it && 'entries' in it) return it;
  7. throw new $TypeError(tryToString(it) + ' is not a map');
  8. };