File: is-weak-map.js

package info (click to toggle)
node-es6-weak-map 2.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 144 kB
  • sloc: makefile: 2
file content (13 lines) | stat: -rw-r--r-- 403 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
"use strict";

var toStringTagSymbol = require("es6-symbol").toStringTag

  , objToString = Object.prototype.toString
  , id = "[object WeakMap]"
  , Global = typeof WeakMap === "undefined" ? null : WeakMap;

module.exports = function (value) {
	return (value && ((Global && (value instanceof Global)) ||
			(objToString.call(value) === id) || (value[toStringTagSymbol] === "WeakMap"))) ||
			false;
};