Traverse an object, converting all ISO strings to real Dates.
JavaScript Makefile
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.eslintrc
.gitignore
HISTORY.md
LICENSE
Makefile
README.md
circle.yml
karma.conf.ci.js
karma.conf.js
package.json

README.md

isodate-traverse

CircleCI Codecov

Traverse an object (or array) and convert all ISO strings into Dates.

Installation

$ npm install @segment/isodate-traverse

Example

var traverse = require('@segment/isodate-traverse');

var obj = {
  date: '2013-09-04T00:57:26.434Z'
};

var traversed = traverse(obj);
// {
//   date: [object Date]
// }

API

traverse(obj, [strict])

Traverse an obj, converting all ISO strings to real Dates. By default, strict mode will be enabled, requiring at least YYYY-MM-DD