Version 1
[yaffs-website] / node_modules / core-js / modules / _collection-to-json.js
diff --git a/node_modules/core-js/modules/_collection-to-json.js b/node_modules/core-js/modules/_collection-to-json.js
new file mode 100644 (file)
index 0000000..ce0282f
--- /dev/null
@@ -0,0 +1,9 @@
+// https://github.com/DavidBruant/Map-Set.prototype.toJSON
+var classof = require('./_classof')
+  , from    = require('./_array-from-iterable');
+module.exports = function(NAME){
+  return function toJSON(){
+    if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic");
+    return from(this);
+  };
+};
\ No newline at end of file