diff --git a/index.js b/index.js index ef54077..7d7f17d 100644 --- a/index.js +++ b/index.js @@ -55,7 +55,11 @@ function deleteFunctions(obj){ } } -module.exports = function serialize(obj, options) { +module.exports.deserialize = function(objStr){ + return new Function("return " + objStr)(); +}; + +module.exports.serialize = function serialize(obj, options) { options || (options = {}); // Backwards-compatibility for `space` as the second argument.