39ffe56d7a5897df6e991bcc921b67997722c5baa42efc776bf1c3be910181df53896bffc2c4e3663fb945d32f4b9ad785fdbcc2e9446072906fbebd49ea59 317 B

123456789
  1. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  2. var classof = require('./_classof');
  3. var 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. };