kitchensink
Version:
Dispatch's awesome components and style guide
26 lines (22 loc) • 531 B
JavaScript
;
module.exports = function () {
var mapForEach = (function () {
if (typeof Map !== 'function') { return null; }
try {
Map.prototype.forEach.call({}, function () {});
} catch (e) {
return Map.prototype.forEach;
}
return null;
}());
var setForEach = (function () {
if (typeof Set !== 'function') { return null; }
try {
Set.prototype.forEach.call({}, function () {});
} catch (e) {
return Set.prototype.forEach;
}
return null;
}());
return { Map: mapForEach, Set: setForEach };
};