Version 1
[yaffs-website] / node_modules / core-js / modules / _collection-to-json.js
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");
7     return from(this);
8   };
9 };