is-weak-map.js 379B

1234567891011121314
  1. 'use strict';
  2. var toStringTagSymbol = require('es6-symbol').toStringTag
  3. , toString = Object.prototype.toString
  4. , id = '[object WeakMap]'
  5. , Global = (typeof WeakMap === 'undefined') ? null : WeakMap;
  6. module.exports = function (x) {
  7. return (x && ((Global && (x instanceof Global)) ||
  8. (toString.call(x) === id) || (x[toStringTagSymbol] === 'WeakMap'))) ||
  9. false;
  10. };