kitchensink
Version:
Dispatch's awesome components and style guide
18 lines (13 loc) • 577 B
JavaScript
;
var isSymbol = require('is-symbol');
module.exports = function getSymbolIterator() {
var symbolIterator = typeof Symbol === 'function' && isSymbol(Symbol.iterator) ? Symbol.iterator : null;
if (typeof Object.getOwnPropertyNames === 'function' && typeof Map === 'function' && typeof Map.prototype.entries === 'function') {
Object.getOwnPropertyNames(Map.prototype).forEach(function (name) {
if (name !== 'entries' && name !== 'size' && Map.prototype[name] === Map.prototype.entries) {
symbolIterator = name;
}
});
}
return symbolIterator;
};