1
0

is-weak-map.js 379 B

12345678910111213
  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. };