]> gerrit.simantics Code Review - simantics/district.git/blob - is-symbol.js
074cb07fb575c278f822bd73f48345487cda9ca3
[simantics/district.git] / is-symbol.js
1 'use strict';
2
3 module.exports = function (x) {
4         if (!x) return false;
5         if (typeof x === 'symbol') return true;
6         if (!x.constructor) return false;
7         if (x.constructor.name !== 'Symbol') return false;
8         return (x[x.constructor.toStringTag] === 'Symbol');
9 };