mirror of
https://github.com/nodejs/node.git
synced 2025-05-18 22:48:50 +00:00

PR-URL: https://github.com/nodejs/io.js/pull/2286 Reviewed-By: Roman Reiss <me@silverwind.io>
13 lines
399 B
JavaScript
13 lines
399 B
JavaScript
'use strict';
|
|
|
|
var toString = Object.prototype.toString
|
|
, toStringTagSymbol = require('es6-symbol').toStringTag
|
|
|
|
, id = '[object Set]'
|
|
, Global = (typeof Set === 'undefined') ? null : Set;
|
|
|
|
module.exports = function (x) {
|
|
return (x && ((Global && ((x instanceof Global) || (x === Global.prototype))) ||
|
|
(toString.call(x) === id) || (x[toStringTagSymbol] === 'Set'))) || false;
|
|
};
|