1 // https://github.com/DavidBruant/Map-Set.prototype.toJSON
2 var classof = require('./_classof')
3 , from = require('./_array-from-iterable');
4 module.exports = function(NAME){
5 return function toJSON(){
6 if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic");