redux-devtools/packages/remotedev-serialize/immutable/index.js
Nathan Bierema ad281ba07a
Add remotedev-serialize package (#562)
* Add remotedev-serialize package

* Update
2020-08-06 16:39:05 -04:00

24 lines
590 B
JavaScript

var jsan = require('jsan');
var serialize = require('./serialize');
var options = require('../constants/options');
module.exports = function(Immutable, refs, customReplacer, customReviver) {
return {
stringify: function(data) {
return jsan.stringify(
data,
serialize(Immutable, refs, customReplacer, customReviver).replacer,
null,
options
);
},
parse: function(data) {
return jsan.parse(
data,
serialize(Immutable, refs, customReplacer, customReviver).reviver
);
},
serialize: serialize
};
};