storage-lite
storage-lite copied to clipboard
Request for adding reviver to json-parsing
I would like to have the ability to json.parse with a reviver. The current storage-lite doesn't let me. By making this posible (with a third parameter), i am able to retreive trully Date-objects instead of string-types (that is when Date-properties get stringified), using this reviver:
var DATEPATTERN = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/;
var reviver = function(key, value) {
return DATEPATTERN.test(value) ? new Date(value) : value;
};
Thanks in advance, Marco.