Note
Segment has paused maintenance on this project, but may return it to an active status in the future. Issues and pull requests from external contributors are not being considered, although internal contributions may appear from time to time. The project remains available under its open source license for anyone to use.
Traverse an object (or array) and convert all ISO strings into Dates.
$ npm install @segment/isodate-traverse
var traverse = require('@segment/isodate-traverse');
var obj = {
date: '2013-09-04T00:57:26.434Z'
};
var traversed = traverse(obj);
// {
// date: [object Date]
// }
Traverse an obj
, converting all ISO strings to real Dates. By default, strict
mode will be enabled, requiring at least YYYY-MM-DD